1 phys (eth-)port, both for LAN _xor_ WAN?

Problem:
openwrt-device with one physical ethernet port only. Default usage is WAN, dhcp provided from upstream.

However, occasionally, i.e. for maintenance, same phys port to be used for LAN instead.
Optimal would be, openwrt-device provides dhcp; otherwise, static IPs to be used.
What would be simplest setup ? Security is no issue.

  • You would change the port to LAN

Assuming that your PHY is eth0:

In /etc/config/network

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

In /etc/config/dhcp

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'
	option ra_management '1'