[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: iptables question



Ritesh Raj Sarraf wrote:
> Paul Cupis on Saturday 18 Mar 2006 17:18 wrote:
>>>Ritesh Raj Sarraf wrote:
>>>>Can someone shed some light on it ?
>>>>
>>>>`iptables -A INPUT -d 192.168.1.1 -p tcp --dport ! 8080 -j DROP`
>>>>
>>>>If I understand correctly the above rule says, "In the INPUT chain of
>>>>iptables, if the destination IP address is 192.168.1.1 and the protocol
>>>>is tcp and the destination port is 8080, then drop those packets".
>>>
>>>The "!" inverts the logic of --dport.
>>>
>>>So this is "...and the destination port IS NOT 8080..."
> 
> Sorry, that was my mistake. A typo.
> So the original statement, corrected, goes:
> 
> "In the INPUT chain of iptables, if the destination IP address is
> 192.168.1.1 and the protocol is tcp and the destination port is NOT 8080,
> then drop those packets".
> 
> So, theoretically when I connect to 192.168.1.1 on port 8080 it should
> connect. Right ?
> But it doesn't. :-(

What other iptables rules do you have?

What do you get if you add:

iptables -A INPUT -j LOG
iptables -A OUTPUT -j LOG



Reply to: