I'm wondering, is it possible to block certain ports on different interfaces such as eth0:0
eth0:1
...
For instance, if I want to block on eth0:0
ports 22
and 25
and leave those open on eth0:1
I'm open to any suggestions!
Thanks guys!
This is acheived by using the -i
option when adding rules to the INPUT
chain.
Here's an example for what you requested (assuming you default drop on your INPUT
chain):
iptables -I INPUT 1 -p tcp -i eth0:1 --dport 22 -j ACCEPT
iptables -I INPUT 1 -p tcp -i eth0:1 --dport 25 -j ACCEPT