I have two network interfaces eth0 and an alias eth0:1 that is my internal network. I want to block port 8140 but also have a rule allowing ANYTHING from the eth0:1 subnet (192.168.1.0/24)
Here is the rule that I have but it seems to be blocking 8140 on all interfaces
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 8140 -j DROP
Chain INPUT (policy ACCEPT 7 packets, 400 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * * 192.168.1.0/24 0.0.0.0/0
0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8140
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 10 packets, 1400 bytes)
pkts bytes target prot opt in out source destination
iptables -L -v -nto your post. – quanta Oct 11 '11 at 4:06