How to configure a gateway

Hi,
I’d like to connect together on the same network some machines with ip addresses 172.20.* and some others with ip addresses 82.38.*.

How can I do?
Do I need ipfilter?
:frowning:
Thanks a lot.
Alain.

You probably need simple routing.

If you have Router/Gateway machine with the qnx6 which have interfaces to both networks:
Add forward to your io-net command “io-net -ptcpip forward” in /etc/system/enum/include/net or if u start io-net manually in /etc/rc.d/rc.local or enable forward by adding “sysctl -w net.inet.ip.forwarding=1” in /etc/rc.d/rc.local
However, each machine in both networks except the router (the machine with interfaces to both networks) which want to connect into other network or wants to be connected from other network must have Default Gateway set to IP of the router (IP from its home network) or must have manually added route to other network (eg: machines in network 172.20.* “route add 82.38.0.0 172.20.1.1” where 172.20.1.1 is the router IP (in 82.38.* it is “route add 172.20.0.0 82.38.1.1” where 82.38.1.1 is the router IP))

If you dont have Router/Gateway, but your machines are on same network segment then:
The machines which want to communicate with each other must have manual route added (as shown above (eg: “route add 172.20.0.0 82.38.xxx.xxx”, …) where 82.38.xxx.xxx is IP of the interface on each machine)

Hi Mezec,

So, I’m in second case i.e. all my machines are on the same network but I think I miss something:

on a 82.38.26.xxx machine I do ‘route add 172.20.0.0 82.38.26.1’
on a 172.20.26.xxx machine I do ‘route add 82.38.0.0 172.20.1.1’

So, a bridge is missing here so I try on the 82.38.26.1 to do ‘ifconfig en0 alias 172.20.1.1’ but that doesn’t work!

The problem is that don’t want to just connect two machines but all 172.20.26.xxx with 82.38.26.xxx

Any idea?
Alain.

Alain.

IP routing uses the address to determine how to route traffic. This is done by using a netmask and a routing table.

Your problem is you are placing two very different networks (ip wise) on the same physical network. This will not work easily (if at all). As long as you only want these machines to talk to one another and not out through a real gateway, you should be able to “open” up the netmask so they know they are on the same segment.

Try something like:

ifconfig en0 netmask 0.0.0.0

and see if that works. My concern is that routing and netmasks are based on the binary value of the network portion of the address. The network portion is defined as xx bits from the left side of the address and the node is defined as the remaining bits. Since your two groups of addresses don’t share any common bits from the left side, my ifconfig line attempts to say that the whole address is a node address and there is no network. I have no idea if it will work.

In other words, this is just wrong from an IP point of view. You may get it to work, but to do it right, you either need a gateway, or you need to change the addresses so they share some network bits in common.

Rick…