Logging Aliased Interfaces.
I am running a firewall with multiple IPs aliased to the
external interface. Each IP is forwarded to a virtual web in he DMZ.
My problem is that it appears, unless I'm doing something wrong,
if the destination address is one of the aliased IPs I can only log and assign rules in PREROUTING. I have complex logging setup in some custom chains, but cannot jump to them from PREROUTING nor assign rules to them in any other chain.
Eth0 = 80.80.80.155
Eth0:1 = 80.80.80.156
Eth0:2 = 80.80.80.157
Network = 80.80.80.152/29
eth0's IP can jump to my user chains, but .156 and .157 cannot
which limits things.
iptables -A INPUT -p tcp --dport 111 -d 80.80.80.155 -i eth0 \ -j LOG --log-prefix "SUN RPC: " This will LOG (if it was -j <USER CHAIN> it would jump)
iptables -A INPUT -p tcp --dport 111 -d 80.80.80.157 -i eth0 \ -j LOG --log-prefix "SUN RPC: " This will not log (if it was -j <USER CHAIN> it would not jump)
iptables -A PREROUTING -p tcp --dport 111 -d 80.80.80.157 -i eth0 \ -j LOG --log-prefix "SUN RPC: " This will LOG (it cannot be -j <USER CHAIN>...only LOG, DNAT and
DROP I think)
Is this enough to go on? Thanks!
Andy
Quoted 13 lines · Andy Wood
I am running a firewall with multiple IPs aliased to the external interface. Each IP is forwarded to a virtual web in the DMZ.
My problem is that it appears, unless I'm doing something wrong,
if the destination address is one of the aliased IPs I can only log and assign rules in PREROUTING. I have complex logging setup in some custom chains, but cannot jump to them from PREROUTING nor assign rules to them in any other chain.iptables -A INPUT -p tcp --dport 111 -d 80.80.80.155 -i eth0 \ -j LOG --log-prefix "SUN RPC: " This will LOG (if it was -j <USER CHAIN> it would jump)
Quoted 8 lines
iptables -A INPUT -p tcp --dport 111 -d 80.80.80.157 -i eth0 \ -j LOG --log-prefix "SUN RPC: " This will not log (if it was -j <USER CHAIN> it would not jump)iptables -A PREROUTING -p tcp --dport 111 -d 80.80.80.157 -i eth0 \ -j LOG --log-prefix "SUN RPC: " This will LOG (it cannot be -j <USER CHAIN>...only LOG, DNAT andDROP I think)
If you are able to log packets in the PREROUTING chain but not the INPUT chain then it implies that they are not being recognised as local packets, and are therefore going to the FORWARD chain instead.
Question: do the packets addressed to 80.80.80.157 seem to be getting processed by this box okay, suggesting that they have traversed the INPUT chain ?
Suggestion: try putting a LOGging rule in the FORWARD chain to see if that's where they're going instead.
Observation: you said at the top of your email:
Quoted 2 lines
I am running a firewall with multiple IPs aliased to the external interface. Each IP is forwarded to a virtual web in the DMZ.
What are your 'forwarding' (presumably DNAT) rules - they must be in the PREROUTING chain - are they causing the dest addr to be changed so the packets no longer go to the local machine ?
If you still have problems, post your entire ruleset (ideally the simplest subset which demonstrates the problem) so we can see everything that's going
on. Please post the commands which set up the rules, not the output of
iptables -L etc.
Antony.
PS: The sig below is randomly generated, and therefore entirely fortuitous on this occasion :-)
Signature · 3 lines
90% of network problems are routing problems. 9 of the remaining 10% are routing problems in the other direction. The remaining 1% might be something else, but check the routing anyway.