thedark Second Lieutenant
Joined: 30 Jul 2005
Posts: 1074
|
Posted: Sun Jul 31, 2005 10:11 am Post subject: block outgoing access to selected/specific ip address |
|
|
You would like to block outgoing access to particuler remote host/ip for alll 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 |
|