Divide Ethernet interface and WiFi interface

Hi all,

I'm not an expert on networking and OpenWRT settings :slight_smile:
I was wondering if it is possible to configure Ethernet interface and WiFi interface and keep them "divided".
I mean, i.e. se the WiFi as client, and get IP,Sub e Gateway from a Wireless access point and manually set the Ethernet interface with different IP, Sub and different Gateway.

Hope the question in clear enough.

Thanks

Yes, option network "lan" in /etc/config/wireless doesn't need to be assigned (bridged) to your lan network.

1 Like

Thanks for your reply
This is the /etc/config/network file:

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

config interface 'lan'
	option proto 'static'
	option _orig_ifname 'eth0'
	option _orig_bridge 'false'
	option ifname 'eth0'
	option netmask '255.255.255.0'
	option enabled '1'
	option ipaddr 'aaa.bbb.ccc.ddd'
	option gateway 'aaa.bbb.ccc.eee'

config interface 'wifi'
        option proto 'dhcp'
        option ifname 'wlan0'

And this the /etc/config/wireless

config wifi-iface
        option device 'radio0'
        option mode 'sta'
        option encryption 'psk2'
        option key 'MyPass'
        option ssid 'MySSID'
        option network 'wifi'

And how to set eth1 interface?
The same as eth0? ( with different IP, sub and gateway as well )

Thanks

Your wifi interface should be static, and have no ifname defined.

1 Like

https://openwrt.org/docs/guide-user/network/wifi/routedap

If you're using your WiFi as the upstream connection, look up how to configure wwan.

1 Like