IP forwarding under QNX 6.1

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

murti@yahoo.com sed in <b0nakk$e50$2@inn.qnx.com>:

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
should be inet 10.102.128.155 netmask 0xffff0000 broadcast 10.102.255.255



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
should be inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255

consult “use ifconfig” for proper setup syntax.
Not necessary a QNX-only quirk (if not missing something more stupid)

kabe

I believe IP forwarding must be enabled using sysctl utility.
– igor

“Murtaza Amiji” <murti@yahoo.com> wrote in message
news:b0nakk$e50$2@inn.qnx.com

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

    \

You were right about the broadcast addresses. I fixed those but the problem
still prevails.

  • Murtaza

<kabe@sra-tohoku.co.jp> wrote in message news:b0nus4$48a$1@inn.qnx.com

murti@yahoo.com > sed in <b0nakk$e50$> 2@inn.qnx.com> >:

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
should be inet 10.102.128.155 netmask 0xffff0000 broadcast 10.102.255.255

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
should be inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255

consult “use ifconfig” for proper setup syntax.
Not necessary a QNX-only quirk (if not missing something more stupid)

kabe

It sounds like the tulip went in promiscuous mode but failed
to inform the stack. Does it happen if you swap the cards
(put the el900 on network 10)?

-seanb

Murtaza Amiji <murti@yahoo.com> wrote:

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

You were right. I swapped the cards, used the el900 as my en0 and the
problem went away. It sure seemed like the tulip driver came up in
promiscuous mode.

  • Murtaza

“Sean Boudreau” <seanb@node25.ott.qnx.com> wrote in message
news:b0rums$s7b$1@nntp.qnx.com

It sounds like the tulip went in promiscuous mode but failed
to inform the stack. Does it happen if you swap the cards
(put the el900 on network 10)?

-seanb

Murtaza Amiji <> murti@yahoo.com> > wrote:
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

    \