Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle devices with wan_dev network section #810

Merged
merged 2 commits into from Mar 14, 2019

Conversation

lantis1008
Copy link
Contributor

@lantis1008 lantis1008 commented Mar 13, 2019

@obsy can you please check this solution.
Reference:

Add to list: on some platform default mac addresses extracted from eeprom are stored in wan_dev/lan_dev section, not wan/lan itself. "Use Custom MAC Address:" should set mac in wan_dev section (if exists).

network.lan=interface
network.lan.type='bridge'
network.lan.ifname='eth0.1'
network.lan.proto='static'
network.lan.ipaddr='192.168.1.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan_dev=device
network.lan_dev.name='eth0.1'
network.lan_dev.macaddr='d4:6e:0e:d0:49:68'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.wan_dev.macaddr='d4:6e:0e:d0:49:69'

Couple of things i'm not sure on, and would be good if you could test/confirm:

  1. Is it necessary to delete wan_dev sections if we delete the main wan section. E.g. lines 154 and 160 (and others). If the wan_dev section causes no issues when it is present, then we will leave it. Definitely concerned about the implications when using wireless or usb protocols for wan
  2. I think gargoyle_header_footer also needs updating (line 945) although it will usually work without it anyway as the mac is sourced directly from the interface. But would be good to add as an extra check. Can you please confirm it works ok as it is, and your opinion on whether it should be modified (i think yes)?
  3. I've done nothing with lan_dev. Do you foresee anytime we need to do this?

@obsy
Copy link
Contributor

obsy commented Mar 13, 2019

  1. no. The wan_dev section can remain even if wan does not exist or wan is qmi proto.
  2. check later.

@obsy
Copy link
Contributor

obsy commented Mar 13, 2019

Looks good.

Initial settings

root@Gargoyle:~# ifconfig eth0.2; uci show network.wan; uci show network.wan_dev
eth0.2    Link encap:Ethernet  HWaddr D4:6E:0E:D0:49:69  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:6280 (6.1 KiB)

network.wan=interface
network.wan.ifname='eth0.2'
network.wan.proto='dhcp'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.wan_dev.macaddr='d4:6e:0e:d0:49:69'

Set to d4:6e:0e:fe:fe:fe, without patch:

eth0.2    Link encap:Ethernet  HWaddr D4:6E:0E:D0:49:69  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:1150 (1.1 KiB)

network.wan=interface
network.wan.ifname='eth0.2'
network.wan.proto='dhcp'
network.wan.macaddr='d4:6e:0e:fe:fe:fe'
network.wan.ipv6='0'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.wan_dev.macaddr='d4:6e:0e:d0:49:69'

after patch & set to d4:6e:0e:fe:fe:fe

root@Gargoyle:~# ifconfig eth0.2; uci show network.wan; uci show network.wan_dev
eth0.2    Link encap:Ethernet  HWaddr D4:6E:0E:FE:FE:FE  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:5254 (5.1 KiB)

network.wan=interface
network.wan.ifname='eth0.2'
network.wan.proto='dhcp'
network.wan.ipv6='0'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.wan_dev.macaddr='d4:6e:0e:fe:fe:fe'

@ericpaulbishop ericpaulbishop merged commit dc7543f into ericpaulbishop:master Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants