Adding New Interface to (/etc/config/network) Doesn't Work!

fmm
 
Posts: 13
Joined: Tue Dec 03, 2019 4:07 pm

Adding New Interface to (/etc/config/network) Doesn't Work!

Wed Jan 01, 2020 8:42 am

Hello World,

This was added to (/etc/config/network):
config interface 'usb_wan'
option ifname 'eth2'
option proto 'dhcp'


Then I run: /etc/init.d/network reload
I also tried: service network restart

but still the interface was not added, and my ifconfig shows:
Code: Select all
apcli0    Link encap:Ethernet  HWaddr BA:D8:12:01:86:44
          inet6 addr: fe80::b8d8:12ff:fe01:8644/64 Scope:Link
          UP BROADCAST RUNNING 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)

br-lan    Link encap:Ethernet  HWaddr B8:D8:12:61:86:45
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fda0:6ca4:618f::1/60 Scope:Global
          inet6 addr: fe80::bad8:12ff:fe61:8645/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2144 (2.0 KiB)

eth0      Link encap:Ethernet  HWaddr B8:D8:12:61:86:45
          inet6 addr: fe80::bad8:12ff:fe61:8645/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:7909 (7.7 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr B8:D8:12:61:86:45
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2144 (2.0 KiB)

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:352 errors:0 dropped:0 overruns:0 frame:0
          TX packets:352 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23936 (23.3 KiB)  TX bytes:23936 (23.3 KiB)

ra0       Link encap:Ethernet  HWaddr B8:D8:12:61:86:44
          inet6 addr: fe80::bad8:12ff:fe61:8644/64 Scope:Link
          UP BROADCAST RUNNING 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:6


Why?

Vonger
 
Posts: 779
Joined: Sun Oct 19, 2014 6:00 am

Re: Adding New Interface to (/etc/config/network) Doesn't W

Thu Jan 02, 2020 1:39 am

You need to setup virtual network first. eth0.1, eth0.2 is the virtual network.
in /etc/config/network, vlan1 means eth0.1, vlan2 means eth0.2

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

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 6t'

detail please check openwrt tutorial.

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 5 guests