Interface configuration wonkiness when using extroot

Hi guys, I'm having a problem with interface static ip configuration.
The ip address of interface eth0.1 is not correctly configured when using extroot:

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP qlen 532
    link/ether 60:38:e0:be:b6:58 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6238:e0ff:febe:b658/64 scope link
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 532
    link/ether 62:38:e0:be:b6:58 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6038:e0ff:febe:b658/64 scope link
       valid_lft forever preferred_lft forever
4: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 62:38:e0:be:b6:58 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0.1
       valid_lft forever preferred_lft forever
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
6: ifb0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 32
    link/ether 7e:25:96:4f:39:8d brd ff:ff:ff:ff:ff:ff
7: ifb1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 32
    link/ether e6:26:29:27:e1:68 brd ff:ff:ff:ff:ff:ff
8: bond0: <BROADCAST,MULTICAST400> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 32:ae:35:54:03:02 brd ff:ff:ff:ff:ff:ff
11: teql0: <NOARP> mtu 1500 qdisc noop state DOWN qlen 100
    link/void
12: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 62:38:e0:be:b6:58 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.1/24 brd 192.168.10.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd41:490f:a9ba::1/60 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::6038:e0ff:febe:b658/64 scope link
       valid_lft forever preferred_lft forever
13: eth1.2@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 60:38:e0:be:b6:58 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6238:e0ff:febe:b658/64 scope link
       valid_lft forever preferred_lft forever
16: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq_codel state UNKNOWN qlen 3
    link/ppp
    inet 123.116.93.189 peer 123.116.64.1/32 scope global pppoe-wan
       valid_lft forever preferred_lft forever
    inet6 fe80::d531:4d9a:95a:43f0/10 scope link
       valid_lft forever preferred_lft forever
19: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP qlen 1000
    link/ether 60:38:e0:be:b6:5a brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6238:e0ff:febe:b65a/64 scope link
       valid_lft forever preferred_lft forever
20: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP qlen 1000
    link/ether 60:38:e0:be:b6:59 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6238:e0ff:febe:b659/64 scope link
       valid_lft forever preferred_lft forever
23: ifb4eth1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc cake state UNKNOWN qlen 32
    link/ether 56:16:f2:08:79:e1 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5416:f2ff:fe08:79e1/64 scope link
       valid_lft forever preferred_lft forever

This is my /etc/config/network:

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

config globals 'globals'
	option ula_prefix 'fd41:490f:a9ba::/48'

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

config interface 'wan'
	option ifname 'eth1.2'
	option proto 'pppoe'
	option username '990001541093'
	option password 'secret'
	option ipv6 'auto'
	option keepalive '0'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 3 5t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'

As you can see the address of interface eth0.1 should be 192.168.10.1 but instead it is 192.168.1.1.
This only happens when I'm using extroot. I'm guessing that this is a bug.
I partially resolved this issue by adding ip a del 192.168.1.1/24 dev eth0.1 to my rc.local

Is this the file from the extroot environment or the non-extroot?

It's from extroot environment, which is the same as non-extroot.

So you've applied the network change to the non-extroot environment first, and then run the extroot process? I have an extroot that runs with no problem on 18.06.1, so I'm inclined to believe it is a config issue, not a bug.

Hmmm, is there any configuration for interface ip address other than /etc/config/network ?

Not that I am aware of. But check that the file (/etc/config/network) is the same between your extroot and non-extroot setups (i.e. boot without the extroot storage plugged in).

Yes they are the same. I used diff to make sure that.

I am out of ideas... hopefully someone else has a theory. Quite odd, for sure.

Does the config change every time you boot up the router or it stays this way even without ExtRoot? How do you access the router,? Is it through 192.168.1.1 or 192.168.10.1?

Without extroot it's totally fine.
This is my routing table when using extroot:

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         114.245.104.1   0.0.0.0         UG    0      0        0 pppoe-wan
114.245.104.1   *               255.255.255.255 UH    0      0        0 pppoe-wan
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0.1
192.168.10.0    *               255.255.255.0   U     0      0        0 br-lan

So I can access router through both 192.168.10.1 and 192.168.1.1

what is the output of ifconfig with and without the extroot booting?

As I can see through your posts here, configuration seems okay in both cases, whether using ExtRoot or not.

In your first post you provided ifconfig output from ExtRoot and it shows that eth0 has 192.168.1.1/24 range and br-lan has 192.168.10.1/24 then in your last post you are showing the routing table with same figures from non ExtRoot config. If I am correct here, your configuration is not wrong. Maybe you need to take a closer look at how things are running. Please correct me if I am wrong somewhere.

Sorry I didn't make it clear, that's the routing table when I'm using extroot.

The difference of the output of ip address show with and without extroot is just the ipv4 address of interface eth0.1
Since ip generally has the same function as ifconfig I think there's no need to show the output of ifconfig

I don't understand how eth0.1 is getting its IP. Does it have its own interface or is it part of br-lan? If it is part of br-lan there should be no IP at all. Even from your current config above it shows that it doesn't have its own interface but it's still getting its IP from somewhere.

Can you post the screenshot from Network -> Interfaces in LuCI?

Example config and output from ifconfig:

br-cloud  Link encap:Ethernet  HWaddr F8:D1:11:99:51:AD
          inet addr:192.168.3.253  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::fad1:11ff:fe99:51ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:65 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6034 (5.8 KiB)  TX bytes:1454 (1.4 KiB)

br-lan    Link encap:Ethernet  HWaddr F8:D1:11:99:51:AB
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::fad1:11ff:fe99:51ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:426103 errors:0 dropped:0 overruns:0 frame:0
          TX packets:564918 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22859971 (21.8 MiB)  TX bytes:840036684 (801.1 MiB)

eth0      Link encap:Ethernet  HWaddr F8:D1:11:99:51:AB
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:403838 errors:0 dropped:0 overruns:0 frame:0
          TX packets:546212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26426735 (25.2 MiB)  TX bytes:813628352 (775.9 MiB)
          Interrupt:5

eth1      Link encap:Ethernet  HWaddr F8:D1:11:99:51:AD
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4

ifb0      Link encap:Ethernet  HWaddr FA:08:F6:E6:D3:D6
          inet6 addr: fe80::f808:f6ff:fee6:d3d6/64 Scope:Link
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:566400 errors:0 dropped:7 overruns:0 frame:0
          TX packets:566393 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:840157875 (801.2 MiB)  TX bytes:840157125 (801.2 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:3684 (3.5 KiB)  TX bytes:3684 (3.5 KiB)

wlan0     Link encap:Ethernet  HWaddr F8:D1:11:99:51:AC
          inet addr:192.168.1.253  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::fad1:11ff:fe99:51ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:639566 errors:0 dropped:0 overruns:0 frame:0
          TX packets:425754 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:948937159 (904.9 MiB)  TX bytes:39576156 (37.7 MiB)

wlan0-1   Link encap:Ethernet  HWaddr FA:D1:11:99:51:AC
          inet6 addr: fe80::f8d1:11ff:fe99:51ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2277 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2230 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:122360 (119.4 KiB)  TX bytes:89172 (87.0 KiB)

wlan0-2   Link encap:Ethernet  HWaddr FE:D1:11:99:51:AC
          inet6 addr: fe80::fcd1:11ff:fe99:51ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22262 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29089 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2398738 (2.2 MiB)  TX bytes:28059746 (26.7 MiB)

wlan0-3   Link encap:Ethernet  HWaddr F2:D1:11:99:51:AC
          inet6 addr: fe80::f0d1:11ff:fe99:51ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2271 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:145190 (141.7 KiB) 

root@AP253:~# cat /etc/config/network

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

config globals 'globals'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option delegate '0'
        option stp '1'
        option _orig_ifname 'eth0 wlan0 wlan0-2'
        option _orig_bridge 'true'
        option ifname 'eth0'
        option ipaddr '192.168.2.1'
        option gateway '192.168.1.253'
        option dns '192.168.2.1'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 0'

config interface 'cloud'
        option type 'bridge'
        option proto 'static'
        option ifname 'eth1'
        option delegate '0'
        option stp '1'
        option ipaddr '192.168.3.253'
        option netmask '255.255.255.0'
        option gateway '192.168.3.1'
        option dns '192.168.3.1'

config interface 'privaterelay'
        option proto 'relay'
        option delegate '0'
        option ipaddr '192.168.1.253'
        list network 'lan'
        list network 'wwan'

config interface 'wwan'
        option _orig_ifname 'wlan0'
        option _orig_bridge 'false'
        option proto 'static'
        option delegate '0'
        option ipaddr '192.168.1.253'
        option netmask '255.255.255.0'
        option gateway '192.168.1.1'
        option dns '192.168.1.1'

The above is just config from my AP but it shows that interfaces only have IPs when there's a backend connection that can support it.

Yes I think there should be no ip for eth0.1 too. btw eth0.1 is a vlan interface
53
This is a screenshot of my luci but I don't think there's more information than /etc/config/network

I know you answered this before, and excuse me if I sound insisting, but after reading all the messages in this thread, the only explanation that I can think of is that you have two different "/etc/config/network" files in your system... are you sure there is just one of them?

1 Like

Sorry I didn't get it. What do you mean by 'two different /etc/config/network". There can't be two different file with the same name.

Yes there can be two files if your Extroot configuration is not being set up right. You may want to look at your config while not in Extroot and compare both configs with each other to see where the problem is occurring.

When the device boots, these is a first initialization, then the extroot is mounted, and then the initialization continues. Before the extroot is mounted, there is one "/etc/config/network" file (that resides in the device); after the extroot isounted, there is another "/etc/config/network" file (that resides on the extroot device).

1 Like