Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Routing of outgoing packets (http://www.linux-archive.org/centos/433816-routing-outgoing-packets.html)

Mitja Mihelič 09-30-2010 02:46 PM

Routing of outgoing packets
 
Hi!

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 74.125.39.147
or
fping -c 2 -I eth2 74.125.39.147
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 74.125.39.147 -VD
or
[root@server ~]# hping3 -c 2 -I eth2 74.125.39.147 -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
(tcptraceroute-1.5-0.beta7.el5.rf.i386.rpm).

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 ?

Regards,
Mitja Mihelic
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Doe 09-30-2010 03:02 PM

Routing of outgoing packets
 
From: Mitja Mihelič <mitja.mihelic@arnes.si>
> 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.

Could you show the ifconfig and route outputs...?

JD



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Mitja Mihelič 10-01-2010 08:30 AM

Routing of outgoing packets
 
On 09/30/2010 05:02 PM, John Doe wrote:
> From: Mitja Mihelič<mitja.mihelic@arnes.si>
>> 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.
> Could you show the ifconfig and route outputs...?
>
> JD
The Centos version is 5.5.

This is the kernel we are using
(http://rpms.mcnc.org/web100/el5/distro-compat/i386/):
2.6.18-164.15.1.el5.web100PAE #1 SMP Mon May 17 17:01:51 EDT 2010 i686
athlon i386 GNU/Linux

The IP addresses are presented as private addresses, netmasks are real.

Here is the ifconfig output:
[root@server ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:35:82:45:A0
inet addr:192.168.254.236 Bcast:192.168.254.239
Mask:255.255.255.240
inet6 addr: fe80::216:35ff:fe82:45a0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:139602 errors:0 dropped:0 overruns:0 frame:0
TX packets:58914 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:211203420 (201.4 MiB) TX bytes:4285647 (4.0 MiB)
Interrupt:186 Memory:dc000000-dc012800

eth1 Link encap:Ethernet HWaddr 00:16:35:82:45:A2
inet addr:192.168.254.244 Bcast:192.168.254.247
Mask:255.255.255.248
inet6 addr: fe80::216:35ff:fe82:45a2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1130 (1.1 KiB) TX bytes:1116 (1.0 KiB)
Interrupt:194 Memory:da000000-da012800

eth2 Link encap:Ethernet HWaddr 00:15:17:C5:84:4D
inet addr:192.168.254.18 Bcast:192.168.254.23
Mask:255.255.255.248
inet6 addr: fe80::215:17ff:fec5:844d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2280 (2.2 KiB) TX bytes:1236 (1.2 KiB)
Memory:dfde0000-dfe00000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:21 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4240 (4.1 KiB) TX bytes:4240 (4.1 KiB)


And the route command output:
[root@server ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
192.168.18.122 192.168.254.225 255.255.255.255 UGH 0 0
0 eth0
192.168.254.16 0.0.0.0 255.255.255.248 U 0 0
0 eth2
192.168.254.240 0.0.0.0 255.255.255.248 U 0 0
0 eth1
192.168.18.160 192.168.254.225 255.255.255.240 UG 0 0
0 eth0
192.168.254.224 0.0.0.0 255.255.255.240 U 0 0
0 eth0
192.168.1.64 192.168.254.225 255.255.255.192 UG 0 0
0 eth0
192.168.1.128 192.168.254.225 255.255.255.128 UG 0 0
0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0
0 eth2
0.0.0.0 192.168.254.241 0.0.0.0 UG 0 0
0 eth1

--
Mitja
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Rob Townley 11-21-2010 11:23 PM

Routing of outgoing packets
 
2010/10/1 Mitja Mihelič <mitja.mihelic@arnes.si>:
>
> On 09/30/2010 05:02 PM, John Doe wrote:
>> From: Mitja Mihelič<mitja.mihelic@arnes.si>
>>> 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.
>> Could you show the ifconfig and route outputs...?
>>
>> JD
> The Centos version is 5.5.
>
> This is the kernel we are using
> (http://rpms.mcnc.org/web100/el5/distro-compat/i386/):
> 2.6.18-164.15.1.el5.web100PAE #1 SMP Mon May 17 17:01:51 EDT 2010 i686
> athlon i386 GNU/Linux
>
> The IP addresses are presented as private addresses, netmasks are real.
>
> Here is the ifconfig output:
> [root@server ~]# ifconfig
> eth0 * * *Link encap:Ethernet *HWaddr 00:16:35:82:45:A0
> * * * * * inet addr:192.168.254.236 *Bcast:192.168.254.239
> Mask:255.255.255.240
> * * * * * inet6 addr: fe80::216:35ff:fe82:45a0/64 Scope:Link
> * * * * * UP BROADCAST RUNNING MULTICAST *MTU:1500 *Metric:1
> * * * * * RX packets:139602 errors:0 dropped:0 overruns:0 frame:0
> * * * * * TX packets:58914 errors:0 dropped:0 overruns:0 carrier:0
> * * * * * collisions:0 txqueuelen:1000
> * * * * * RX bytes:211203420 (201.4 MiB) *TX bytes:4285647 (4.0 MiB)
> * * * * * Interrupt:186 Memory:dc000000-dc012800
>
> eth1 * * *Link encap:Ethernet *HWaddr 00:16:35:82:45:A2
> * * * * * inet addr:192.168.254.244 *Bcast:192.168.254.247
> Mask:255.255.255.248
> * * * * * inet6 addr: fe80::216:35ff:fe82:45a2/64 Scope:Link
> * * * * * UP BROADCAST RUNNING MULTICAST *MTU:1500 *Metric:1
> * * * * * RX packets:15 errors:0 dropped:0 overruns:0 frame:0
> * * * * * TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
> * * * * * collisions:0 txqueuelen:1000
> * * * * * RX bytes:1130 (1.1 KiB) *TX bytes:1116 (1.0 KiB)
> * * * * * Interrupt:194 Memory:da000000-da012800
>
> eth2 * * *Link encap:Ethernet *HWaddr 00:15:17:C5:84:4D
> * * * * * inet addr:192.168.254.18 *Bcast:192.168.254.23
> Mask:255.255.255.248
> * * * * * inet6 addr: fe80::215:17ff:fec5:844d/64 Scope:Link
> * * * * * UP BROADCAST RUNNING MULTICAST *MTU:1500 *Metric:1
> * * * * * RX packets:29 errors:0 dropped:0 overruns:0 frame:0
> * * * * * TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
> * * * * * collisions:0 txqueuelen:1000
> * * * * * RX bytes:2280 (2.2 KiB) *TX bytes:1236 (1.2 KiB)
> * * * * * Memory:dfde0000-dfe00000
>
> lo * * * *Link encap:Local Loopback
> * * * * * inet addr:127.0.0.1 *Mask:255.0.0.0
> * * * * * inet6 addr: ::1/128 Scope:Host
> * * * * * UP LOOPBACK RUNNING *MTU:16436 *Metric:1
> * * * * * RX packets:21 errors:0 dropped:0 overruns:0 frame:0
> * * * * * TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
> * * * * * collisions:0 txqueuelen:0
> * * * * * RX bytes:4240 (4.1 KiB) *TX bytes:4240 (4.1 KiB)
>
>
> And the route command output:
> [root@server ~]# route -n
> Kernel IP routing table
> Destination * * *Gateway * * * * *Genmask * * * * *Flags Metric Ref
> Use Iface
> 192.168.18.122 * 192.168.254.225 *255.255.255.255 *UGH * 0 * * *0
> 0 eth0
> 192.168.254.16 * 0.0.0.0 * * * * *255.255.255.248 *U * * 0 * * *0
> 0 eth2
> 192.168.254.240 *0.0.0.0 * * * * *255.255.255.248 *U * * 0 * * *0
> 0 eth1
> 192.168.18.160 * 192.168.254.225 *255.255.255.240 *UG * *0 * * *0
> 0 eth0
> 192.168.254.224 *0.0.0.0 * * * * *255.255.255.240 *U * * 0 * * *0
> 0 eth0
> 192.168.1.64 * * 192.168.254.225 *255.255.255.192 *UG * *0 * * *0
> 0 eth0
> 192.168.1.128 * *192.168.254.225 *255.255.255.128 *UG * *0 * * *0
> 0 eth0
> 169.254.0.0 * * *0.0.0.0 * * * * *255.255.0.0 * * *U * * 0 * * *0
> 0 eth2
> 0.0.0.0 * * * * *192.168.254.241 *0.0.0.0 * * * * *UG * *0 * * *0
> 0 eth1
>
> --
> Mitja
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>

This may be too late, but came across this searching for my old
iproute conversations.
Each NIC needs its own "source based route" otherwise, it will use the
sytem wide default route.
In other words, add "nic specific default routes" in addition to the
"system wide default route".

Once you have nic specific source routes, you may notice a big
difference between the following two seemingly identical commands:
ping -I eth2 208.67.222.222
ping -I 192.168.x.y 208.67.222.222
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 05:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.