Monday, June 25, 2007
Linux Iptables block outgoing access to selected or specific ip address
You would like to block outgoing access to particular remote host/ip for all or selected service/port.
Following rule will block ip address 202.54.1.22 from making any outgoing connection:
iptables -A OUTPUT -d 202.54.1.22 -j DROP
This way you can block chat server ip address or site having dangerous contains such as viruses. It is also possible to block specific port. For example to you can block tcp 5050 port as follows:
iptables -A OUTPUT -p tcp -dport 5050 -j DROP
OR block 5050 for IP address 192.168.1.2 only:
iptables -A OUTPUT -p tcp -d 192.168.1.2 -dport 5050 -j DROP
Share It:
·
·
·
·
·
·
·
More Bookmarks...
Following rule will block ip address 202.54.1.22 from making any outgoing connection:
iptables -A OUTPUT -d 202.54.1.22 -j DROP
This way you can block chat server ip address or site having dangerous contains such as viruses. It is also possible to block specific port. For example to you can block tcp 5050 port as follows:
iptables -A OUTPUT -p tcp -dport 5050 -j DROP
OR block 5050 for IP address 192.168.1.2 only:
iptables -A OUTPUT -p tcp -d 192.168.1.2 -dport 5050 -j DROP
Share It:
·
·
·
·
·
·
·
More Bookmarks...
Subscribe to Posts [Atom]