Multi configuration

Hello. I am trying multiple configurations. wan1(dhcp), wan2(dhcp) -> lan1(static), lan2(static) I want to set it to one openwrt.

wan1(222.222.221.1) - > lan1(192.168.0.1)
wan1(211.111.111.1) - >.lan2(192.168.0.2)

You need to do Policy Based Routing and you have 3 options:

  1. mwan3 package
  2. pbr package
  3. a set of rules/routes for each internet connection.
3 Likes

What should I do to make number 3? Please tell me how.

Create a rule for the lan traffic to be routed out of the wan interface with a route.

1 Like

I'm asking wan dhcp address, not vpn, to bite multiple interfaces in a 1:1 way to lan.

wan0~10 <-> lan 0~10

The rules/routes are not limited to vpns.

To bind I presume you mean.

Create 11 rules one for each lan IP and assign it to a table 101-111.
Then create 11 routes for the default gateway of the 11 tables.

2 Likes

Thank you penguin. I can stimulate the search. Thank you very much. Routing / Gateway problem This post is similar to me.

1 Like

It is not working normally. Please check once, thank you.

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

config globals 'globals'
	option ula_prefix 'fd15:5672:3a87::/48'
	option multipath 'disable'
	option mptcp_path_manager 'fullmesh'
	option mptcp_scheduler 'default'
	option mptcp_checksum '0'
	option mptcp_debug '0'
	option mptcp_syn_retries '5'
	option mptcp_fullmesh_num_subflows '1'
	option mptcp_fullmesh_create_on_err '1'
	option mptcp_ndiffports_num_subflows '1'
	option congestion 'cubic'

config interface 'wan'
	option proto 'dhcp'
	option multipath 'off'
	option ifname 'eth0'

config interface 'lan'
	option proto 'static'
	option multipath 'off'
	option netmask '255.255.254.0'
	option ifname 'eth1'
	option ipaddr '192.168.0.28'

config interface 'wan02'
	option proto 'dhcp'
	option ifname 'eth2'
	option multipath 'off'

config interface 'lan02'
	option proto 'static'
	option ifname 'eth3'
	option multipath 'off'
	option ipaddr '192.168.0.35'
	option netmask '255.255.254.0'

config interface 'wan03'
	option proto 'dhcp'
	option ifname 'eth4'
	option multipath 'off'

config interface 'lan03'
	option proto 'static'
	option ifname 'eth5'
	option multipath 'off'
	option ipaddr '192.168.0.36'
	option netmask '255.255.254.0'

config rule
	option in 'lan02'
	option src '192.168.0.35/23'
	option lookup '101'

config route
	option interface 'wan02'
	option target '192.168.0.35'
	option netmask '255.255.254.0'
	option table '101'

All 3 lan interfaces are using conflicting IPs. You need to use proper IPs/masks.
lan 192.168.0.1/23
lan02 192.168.2.1/23
lan03 192.168.4.1/23
Also the route is wrong.

config route
	option interface 'wan02'
	option target '0.0.0.0'
	option netmask '0.0.0.0'
	option gateway 'x.x.x.x'
	option table '101'
1 Like

Is gateway x.x.x.x the lan address?
Is lan,lan01,lan02 unavailable for 192.168.0.x? I am wondering how the connection goes to 192.168.x.1.

thank you for the reply.

Gateway x.x.x.x is the gateway for the wan connection.

You cannot have multiple interfaces in the same subnet if they are not bridged.

Computer network lan02 Photo
1

Computer network lan03 Photo
2

Is this setting correct? I am quite confused.

No it is not correct, the IP and the gateway do not belong to the same subnet.

1 Like

Is there any other way? You must use the same subnet. Use 192.168.0.x lan assigned address.

There is no other way, gateway must belong to the same subnet.

1 Like

one openwrt vm

DHCP
wan01(221.111.111.1)
wan02(222.123.123.2)
wan03(220.211.155.3)

Subnet 255.255.254.0

lan01(192.168.0.1) pc Gateway
lan02(192.168.0.2) pc Gateway
lan03(192.168.0.3) pc Gateway

This is the configuration. I hope there is a way to solve it.

As I told you before, the lans are using conflicting IPs.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.