OpenWrt Forum Archive

Topic: Network Configuration

The content of this topic has been archived on 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all
I have 2 lans
wan: 192.168.0.1 dhcp client
lan1: 192.168.1.1 static ip and works as dhcp server
lan2: 192.168.2.1 static ip and works as dhcp server

lan1 uses wan for connecting to internet
in firewall:
lan=>wan

for some reasons I want to define another interface like wan2 so works as dhcp client for lan1 and also acts as wan for connecting to internet for lan2 (and ofcourse have IP like 192.168.1.x)
I mean:
in firewall:
lan2=>wan2
and because wan2 is dhcp client of lan1 and lan1=>wan so I can connect to internet by lan2
I repeat my purpose is to create an interface that be dhcp client for lan1 and I can configure it in firewall to be wan port for lan2

what shoud I do?
am I need vlans?

please help

Best Regards!

You cannot "define interfaces" in OpenWRT. The section name is called 'config interface' in /etc/config/network, but what it really does is declare a logical network.

In order to accomplish what you want, you'd need to either purchase additional network interface card(s) (e.g. USB-to-Ethernet adapter(s)) or resort to creating virtual adapters using existing hardware.

If you choose the latter option, then VLANs is probably the most effective way to achieve what you want.

You can also tackle the problem by creating a VPN server that is connected to 'lan1', and running a VPN client that connects to this server (which resides in the same router). The VPN client would then act as 'wan2' for the 'lan2' network. However, I think this kind of an approach would be a complete overkill.

The discussion might have continued from here.