[CentOS] Routing of outgoing packets
mitja.mihelic at arnes.si
Thu Sep 30 10:46:38 EDT 2010
I am trying to use hping to chek the latency of our network.
Somehow things are not going to plan and I thought someone might be able
to shed some light on the subject.
Here is the setup:
(the IP addresses gvien here are fake, but they do represent the correct
state of the networking setup)
vlan interface IP mask
V2 eth0 192.168.20.20 32
V4 eth1 172.16.4.40 32
V6 eth2 172.16.6.60 32
The default route is set to eth1.
The idea is to use eth2 for pinging only, the other two interfaces are
used by another service and management access.
If I do:
ping -c 2 -I eth2 220.127.116.11
fping -c 2 -I eth2 18.104.22.168
It binds to eth2 and sends its ICMP probes via that interface with the
IP on that interface.
If I do:
hping3 -1 -c 2 -I eth2 22.214.171.124 -VD
[root at server ~]# hping3 -c 2 -I eth2 126.96.36.199 -VD
DEBUG: if lo: Don't Match (but seems to be UP)
DEBUG: if eth0: Don't Match (but seems to be UP)
DEBUG: if eth1: Don't Match (but seems to be UP)
DEBUG: if eth2: OK
using eth2, addr: 172.16.6.60, MTU: 1500
It supposedly binds to eth2. But tcpdump tells another story.
Packets get sent out via the default route (eth1) with the IP from eth2
set as the source address.
The same happens with tcptraceroute
I have tried various routing policies, but I have yet to find a solution
I have used iptables to log the packets in the OUTPUT chain, but they
arrive there with the interface already set to eth1.
Can anyone help ?
More information about the CentOS