iptables -I INPUT -m udp -p udp --dport 161 -s ! 172.17.1.2/32 -j DROP
iptables -I INPUT -m udp -p udp --dport 162 -s ! 172.17.1.2/32 -j DROP
then save them somewhere, for instance /etc/rc.d/rc.firewall or /etc/rc.d/rc.local, so that they are not lost on a reboot
These rules are for systems that have a default ACCEPT policy. If on the other-hand you have a default DROP policy on your system try the following rules instead:
iptables -I INPUT -m udp -p udp --dport 161 -s 172.17.1.2/32 -j ACCEPT
iptables -I INPUT -m udp -p udp --dport 162 -s 172.17.1.2/32 -j ACCEPT
Last edited by SlackDaemon; 05-08-2007 at 06:34 AM.
|