linux - iptables blocking access to IP from an interface but not local -
i have system 2 interfaces, wlan1 , eth0.
eth0 has access internet , wlan1 gets access internet through eth0. want block access websites though ip. here have done. kills access ip on eth0 not on wlan1...or blocks access on wlan1. have , when run it, cannot browse internet @
echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -f iptables -t nat -a postrouting -o eth0 -j masquerade iptables -f iptables -a forward -i wlan1 -o eth0 -j accept # ports need access iptables -i input -i wlan1 -p udp --dport 123 --sport 123 -j accept iptables -i input -i wlan1 -p udp --dport 67:68 --sport 67:68 -j accept iptables -a output -p udp --dport 123 -j accept iptables -a input -p udp --sport 123 -j accept iptables -a output -p udp -o wlan1 --dport 53 -j accept # drop connection 108.167.183.84 on wlan1 iptables -a output -d 108.167.183.84 -j drop
what don't understand is, if take last iptables command after forward, whole thing works backwards...i access nothing 108.167.183.84:
echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -f iptables -t nat -a postrouting -o eth0 -j masquerade iptables -f iptables -a forward -i wlan1 -o eth0 -j accept # drop connection 108.167.183.84 on wlan1 iptables -a output -d 108.167.183.84 -j drop # without # ports need access iptables -i input -i wlan1 -p udp --dport 123 --sport 123 -j accept iptables -i input -i wlan1 -p udp --dport 67:68 --sport 67:68 -j accept iptables -a output -p udp --dport 123 -j accept iptables -a input -p udp --sport 123 -j accept iptables -a output -p udp -o wlan1 --dport 53 -j accept
can me understand why happens?
thanks
Comments
Post a Comment