Hi, i want to allow web page access only for specific mac address or on a specific interface only .
i try editing /etc/config/uhttpd to
config uhttpd 'main'
list listen_http '80'
list listen_http '[::]:80'
list listen_https '192.168.16.1:443' // static interface address #list listen_https '[::]:443'
option redirect_https '0'
option home '/www'
option rfc1918_filter '1'
option max_requests '3'
option max_connections '100'
option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key'
option cgi_prefix '/cgi-bin'
list lua_prefix '/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'
option script_timeout '60'
option network_timeout '30'
option http_keepalive '20'
option tcp_keepalive '1'
option ubus_prefix '/ubus'
but unable to access web on this.
is there anything wrong with my config file or there is some other problem?
remove
list listen_http '80'
change from
list listen_http '[::]:80'
to
list listen_http '192.168.16.1:80'
change from
option redirect_https '0'
to
option redirect_https '1'
and
/etc/init.d/uhttpd restart
i was trying to answer the first problem he wants to access the uhttpd interface then when he would have accessed the interface an iptables rule is created to allow access to a certain ip/mac ...
if the answer is yes then you need to create a new firewall rule
that allows only a specific ip/mac to access
config rule
option dest_port '80 443'
list proto 'tcp'
option name 'block access_web_interface'
list src_ip '!192.168.16.2'
option target 'DROP'
option src 'lan'
option family 'ipv4'
if the answer is no then first you need to solve the first problem...
config interface 'wan'
option device 'wan'
option proto 'static'
option ipaddr '192.168.16.1'
option netmask '255.255.255.0'
option delegate '0'
list dns '8.8.8.8'
list dns '1.1.1.1'
list dns '8.8.4.4'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan4'
Leave the uhttpd configuration as it was and create a firewall rule to allow only the specific mac to destination port 80 and 443 on the device from the desired zone. Make sure the zone has input deny or you have another rule to deny ports 80 and 443.
config rule
option dest_port '80 443'
list proto 'tcp'
option name 'block access_web_interface'
list src_ip '!192.168.15.2'
option target 'DROP'
option src 'test'
option family 'ipv4'