sending pkts on wire even if dest is local

This is a discussion on sending pkts on wire even if dest is local within the Linux Networking forums, part of the Linux Forums category; Hello folks, I have a linux box with three gigabit network cards. All the three network cards are on different ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-15-2007
Tejas Kokje
 
Posts: n/a
Default sending pkts on wire even if dest is local

Hello folks,

I have a linux box with three gigabit network cards. All the three
network cards are on different subnets. and are connected to a
switch. The diagram is as shown below

A, B and C are the network interfaces with IP address 192.168.2.1,
192.168.3.1 and 192.168.4.1

I want to send a unicast packet from A to B and from A to C in order
to look if my software on switch is working fine. But I guess linux
kernel sees that both B and C are local interfaces and hence does not
send it on wire.
_______
A----------| |
| |
B--------- | X |
| |
C----------|______ |


Is there a way I can force kernel to send all unicast packets on wire
and not optimize it if destination is a local interface ? Being
limited on resources, I don't have another linux box :-(

Thanks,
Tejas Kokje

Reply With Quote
  #2 (permalink)  
Old 02-15-2007
Pascal Hambourg
 
Posts: n/a
Default Re: sending pkts on wire even if dest is local

Hello,

Tejas Kokje a écrit :
>
> I have a linux box with three gigabit network cards. All the three
> network cards are on different subnets. and are connected to a
> switch.


In the same VLAN ? This may be a bad idea because it has known issues,
especially regarding ARP.

> A, B and C are the network interfaces with IP address 192.168.2.1,
> 192.168.3.1 and 192.168.4.1


Note that the owner of a local address is more the host itself than the
interface. For instance, by default Linux will answer and reply ARP
queries and accept traffic for any local address (except 127.0.0.0/8) on
any interface. This behaviour may be changed with parameters in
/proc/sys/net/ipv4/conf/ (check networking/ip-sysctl.txt in the kernel
documentation).

> I want to send a unicast packet from A to B and from A to C in order
> to look if my software on switch is working fine. But I guess linux
> kernel sees that both B and C are local interfaces and hence does not
> send it on wire.


Correct. Loopback routes have the highest priority.

> Is there a way I can force kernel to send all unicast packets on wire
> and not optimize it if destination is a local interface ?


Sure. Add static ARP entries associating a dummy IP address with the MAC
address of the target interface and send the packet to that dummy IP
address. Of course the IP stack will drop the packet because the
destination address is not a local address (or may forward it again if
ip_forward is enabled).

Or you may try to send the packet with an arbitrary packet generator at
link-level, by-passing the IP routing.

> Being limited on resources, I don't have another linux box :-(


What about virtual machines hosted by the physical box (seems most
trendy these days) ?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0