[CentOS] Routing of outgoing packets

Mitja Mihelič 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     32
V4        eth1         32
V6        eth2         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
fping -c 2 -I eth2
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 -VD
[root at server ~]# hping3 -c 2 -I eth2 -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:, 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 
that works.
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 ?

Mitja Mihelic

More information about the CentOS mailing list