I recently switched to a new ISP (Monkeybrains) which allows connecting WAN via DHCP without a modem. However, upon first boot I get a local IP on the WAN IPv4 interface (the wan6 interface is unaffected). This is not resolved until running ifup wan
or service network restart
, and after restarting the interface again it reverts back to a local IP. How should I work around this?
Network config:
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 packet_steering '1'
option ula_prefix 'fdff:e93d:66d7::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '10.1.0.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth0.2'
option proto 'dhcp'
option peerdns '0'
list dns '9.9.9.9'
list dns '149.112.112.112'
config interface 'wan6'
option proto 'dhcpv6'
option device 'eth0.2'
option ip6ifaceid 'random'
option peerdns '0'
option reqaddress 'try'
option reqprefix 'auto'
list dns '2620:fe::fe'
list dns '2620:fe::9'
Example behavior:
root@OpenWrt ~# udhcpc -i eth0.2
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting select for 192.168.88.252, server 192.168.88.1
udhcpc: lease of 192.168.88.252 obtained from 192.168.88.1, lease time 600
udhcpc: ip addr add 192.168.88.252/255.255.255.0 broadcast + dev eth0.2
udhcpc: setting default routers: 192.168.88.1
root@OpenWrt ~# udhcpc -i eth0.2
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting select for 170.XX.XXX.XXX, server 208.69.43.18
udhcpc: lease of 170.XX.XXX.XXX obtained from 208.69.43.18, lease time 3601
udhcpc: ip addr add 170.XX.XXX.XXX/255.255.255.0 broadcast + dev eth0.2
udhcpc: setting default routers:170.XX.XXX.1
# Restarting the interface again reverts back to local IP
root@OpenWrt ~# udhcpc -i eth0.2
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting select for 192.168.88.252, server 192.168.88.1
udhcpc: lease of 192.168.88.252 obtained from 192.168.88.1, lease time 600
udhcpc: ip addr add 192.168.88.252/255.255.255.0 broadcast + dev eth0.2
udhcpc: setting default routers: 192.168.88.1
root@OpenWrt ~# udhcpc -i eth0.2
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting select for 170.XX.XXX.XXX, server 208.69.43.18
udhcpc: lease of 170.XX.XXX.XXX obtained from 208.69.43.18, lease time 3601
udhcpc: ip addr add 170.XX.XXX.XXX/255.255.255.0 broadcast + dev eth0.2
udhcpc: setting default routers:170.XX.XXX.1