Configuring static routing for 2 routers with different subnets?

If you want to post the network config files (complete) for both routers, we can do a final review to make sure it looks right.

10.0.0.1 router

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd08:29f9:d276::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '10.0.0.1'

config device
	option name 'eth0.2'
	option macaddr 'xxxxxxxxxxxx'

config interface 'wan'
	option device 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option device 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '1'
	option ports '0t 2 3 4'

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option ports '0t 5'
	option vid '3'
	option description 'xconnect'

config interface 'xconnect'
	option proto 'static'
	option device 'eth0.3'
	option ipaddr '192.168.2.4'
	option netmask '255.255.255.0'

config route
	option target '192.168.1.0/24'
	option gateway '192.168.2.2'
	option interface 'xconnect'

192.168.1.1 router


config interface 'loopback'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'
	option device 'lo'

config globals 'globals'
	option ula_prefix 'fd7d:2300:7fde::/48'

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option device 'br-lan'

config interface 'wan'
	option device 'eth1'
	option proto 'dhcp'

config interface 'wan6'
	option proto 'dhcpv6'
	option device '@wan'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'
	option blinkrate '2'
	option enable_vlan4k '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 5t'

config switch_port
	option device 'switch0'
	option port '1'
	option led '6'

config switch_port
	option device 'switch0'
	option port '2'
	option led '9'

config switch_port
	option device 'switch0'
	option port '5'
	option led '2'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config switch_vlan
	option device 'switch0'
	option ports '0 5t'
	option vlan '2'
	option description 'xconnect'

config route
	option target '10.0.0.0/24'
	option gateway '192.168.2.4'
	option interface 'xconnect'

config interface 'xconnect'
	option proto 'static'
	option device 'eth0.2'
	option ipaddr '192.168.2.2'
	option netmask '255.255.255.0'


Now I just hope everything goes smoothly when I plug in the new modem on Monday and actually get internet.

I don't see a switch entry for eth0.2 (for your WAN), so I don't think this is quite right.
You probably want something like this (assuming that logical port 1 maps to the physical wan port on your device):

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0t 1'
	option vid '2'

Otherwise, I think it all looks good.

1 Like

Thanks. I will add that in there and report back after I try my luck in a couple of days!

Sounds good! if all goes well, be sure to mark this thread as solved. And if not, we'll keep working on it.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

I woke up early today and was bored and figured I would try and test the wan. Using the 192.168.1.1 router as my internet source. I connected an ethernet cable to just a normal lan port on 192 router and then to the WAN port on the 10.0.0.1 router. And I couldn't get any internet.

I ended up making one of the lan ports a wan and changed the wan/wan6 interface to use eth0.4 Reconnected the cable and picked up internet right away. So I should be good to go for tomorrow.