Hi,
I am seeing an IP address conflict when I configure a QNX box with two NICs
as a static router. Below are the commands I issue on this box:
io-net -d tulip -d el900 -p tcpip forward // Load the two NIC drivers
with io-net, and load tcpip stack with forwarding option
ifconfig en0 10.102.128.155 255.255.0.0 // configure the public
interface with the IP: 10.102.128.155
ifconfig en1 192.168.1.1 255.255.255.0 // configure the private
interface with IP: 192.168.1.1
route add default 10.102.128.1 // Add a default route
which would use the en0 interface
add net default: gateway 10.102.128.1
After issuing the above commands, the route table looks like:
netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu
Interface
default 10.102.128.1 UGS 0 0 - en0
10 10.102.128.155 U 1 0 - en0
10.102.128.155 10.102.128.155 UH 0 0 - lo0
127.0.0.1 127.0.0.1 UH 0 0 - lo0
192.168.1 192.168.1.1 U 0 0 - en1
192.168.1.1 192.168.1.1 UH 0 0 - lo0
Output of ifconfig looks like:
ifconfig -a
lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 32976
inet 127.0.0.1 netmask 0xff000000
en0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
address: 00:10:6f:03:04:20
inet 10.102.128.155 netmask 0xff000000 broadcast 255.255.0.0
en1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
address: 00:60:08:1f:00:9d
inet 192.168.1.1 netmask 0xffffff00 broadcast 255.255.255.0
The QNX gateway is connected via a hub on the LAN so it gets all the
Etherent packets. Strange things are happening on the network that I cannot
seem to figure out. If another box (I’ll call it A) on the 10.102.x.x
subnet tries to talk to yet another box on the same subnet (call it B),
packets from A are also routed to the QNX gateway because the gateway is
connected to the subnet via a hub. When packets arrive at the en0 interface
of the gateway, IP forwarding seems to kick in and the stack changes the
source MAC address and sends the packets back out on the same interface
(en0) while keeping the source IP address intact. The packets reach machine
A and it complains after looking at the source IP and MAC address. It
notices that someone else is using the same IP that A is assigned.
I was under impression that the forwarding would takes packets from en0 and
put them out on en1. Its likely I have screwed up somewhere in my
configuration. Would appreciate if someone can point out where my mistakes
are and why this may be happening.
Thanks
- Murtaza