Filtering in iptables mangle?
Is there any side effects filtering packets in prerouting in the mangle table. I have the computer connected to two subnets. eth0 my private network and eth1 the university network which is also my internet. I used to have these in the nat table but read that they can be bypassed under certain ceircumstances. This is mainly to prevent people from setting their default gateway to my computer to access my private network ip_forwarding lets them do this otherwise
#Block Gateway Attempts from eth1 iptables -t mangle -A PREROUTING -i eth1 -d ! 172.26.16.0/24 -j DROP # Block packet Spoof Attempts from eth1 iptables -t mangle -A PREROUTING -i eth1 -s 192.168.0.0/16 -j DROP # Block Gateway Attempts from tun0 (VPN) iptables -t mangle -A PREROUTING -i tun0 -d 192.168.0.0/16 -j DROP iptables -t mangle -A PREROUTING -i tun0 -d 172.16.0.0/12 -j DROP # Block packet Spoof Attempts from tun0 iptables -t mangle -A PREROUTING -i tun0 -s 192.168.0.0/16 -j DROP iptables -t mangle -A PREROUTING -i tun0 -s 172.16.0.0/12 -j DROP I noticed that openvpn has been disconnecting after i moved these from nat to mangle. Thanks, MarleyGPN |
Opening on a humorous note: To quote a local Widiot (tm:)) "Why would you want to do thaaat?" This in an MCSE class discussing *nix ability to accept multiple simultaneous log-ins.
Well, why would you want to do that? -- Oskar Andreasson in Iptables Tutorial 1.1.19 says don't do that: (3.2. mangle table) Quote:
If Oskar were asked "Is there any side effects filtering packets in prerouting in the mangle table.", his short answer might be "Yes, all bad." Hope this helps, please post your results. |
All times are GMT -5. The time now is 02:04 AM. |