Question on swapping WAN/LAN on RPi4B + UE300

I have my RPi4B's UE300 (eth1) connected to the WAN and the internal LAN (eth0) connected to my LAN. I would like to flip-flop it for some testing (connect the WAN to eth0 and connect the LAN to eth1).

In addition to the physical connections, I wanted to verify that I only need to change all references to "eth0" in /etc/config/network to "eth1" and vice-versa. Once I do that, I should be able to just restart the network and be good to go, no (ie /etc/init.d/network restart)?

I am currently using VLANs via 8021q devices so they too would be renamed from eth0.x to eth1.x, for reference:

`/etc/config/network`
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 'fd1a:184b:b879::/48'
	option packet_steering '1'

config device
	option name 'eth0'
	option ipv6 '0'

config device
	option name 'eth1'
	option ipv6 '0'

config device
	option name 'wg0'
	option ipv6 '0'

config device
	option type 'bridge'
	option name 'lxcbr0'
	option ipv6 '0'
	option bridge_empty '1'

config device
	option name 'eth0.1'
	option type '8021q'
	option ifname 'eth0'
	option vid '1'
	option ipv6 '0'

config device
	option name 'eth0.3'
	option type '8021q'
	option ifname 'eth0'
	option vid '3'
	option ipv6 '0'

config device
	option name 'eth0.5'
	option type '8021q'
	option ifname 'eth0'
	option vid '5'
	option ipv6 '0'

config interface 'wan'
	option device 'eth1'
	option proto 'dhcp'
	option peerdns '0'
	option delegate '0'
	list dns '1.1.1.1'
	list dns '1.0.0.1'

config interface 'lxc'
	option device 'lxcbr0'
	option proto 'static'
	option ipaddr '10.0.40.1'
	option netmask '255.255.255.0'

config interface 'lan'
	option device 'eth0.1'
	option proto 'static'
	option ipaddr '10.9.80.1'
	option netmask '255.255.255.0'

config interface 'guest'
	option device 'eth0.3'
	option proto 'static'
	option ipaddr '10.9.70.1'
	option netmask '255.255.255.0'

config interface 'iot'
	option device 'eth0.5'
	option proto 'static'
	option ipaddr '10.9.50.1'
	option netmask '255.255.255.0'

config interface 'wg0'
	option proto 'wireguard'
...
# rest of file is wg specific so omitted

Yes, you've got it right. Simply swap all references of eth0 for eth1 and vice versa. Don't forget all your VLANs. Then restart the network service as you have also described.

You might want to enable the onboard wifi for administrative purposes just in case you make any mistakes -- this way you can get in to fix the config regardless of the ethernet port status. You can disable it after. Or, have a monitor and keyboard handy to use the built-in console.

Interestingly, I also had to power cycle the modem to get the ISP to assign an external IP.

This is not uncommon, especially for cable modem based ISPs. Sorry I didn't mention it. The modem 'learns' the MAC address of the downstream device and will only issue an IP to that MAC. Restarting the modem (sometimes a few restarts are necessary) will clear that learned MAC and allow a new one to be associated.

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