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) ?
|