I have a ubuntu router machine with following network settings:
br0 192.168.1.15 netmask 255.255.255.0
br0:1 192.168.2.209 netmask 255.255.255.248
I have a pc attached to the br0:1
network with these settings:
ip 192.168.2.210 netmask 255.255.255.248 gateway 192.168.2.209
This pc should be able to access the host 192.168.1.1
which is on the br0 network of ubuntu router.
192.168.1.1
is the WAN gateway, so how can I make it a gateway for the hosts on 192.168.2.208/29
network.
I have enabled ip4 forwarding on the ubuntu router.
First make sure
192.168.2.209
is the default gateway for192.168.2.210
and the Ubuntu router allows traffic from the host. On192.168.2.210
:On the Ubuntu router:
Then you have two options. You can either SNAT the forwarded traffic on the Ubuntu router, so that 192.168.1.1 sees it as belonging to the router and knows how to return it:
or you can add the following route on the
192.168.1.1
gateway, assuming it's also a Linux host:Which tells it how to route the packets back to that network. Of course if the gateway is filtering you will have to add filter rules for the
192.168.2.209/29
network too:Of course these last rules can be improved with more information.