Problems in vlan and my secondary network adapter in nanostation ac

In the Ubiquiti configuration I have my two network interfaces and manage them as I please, in openwrt it becomes a switch0 with vlan: one interface eth0, two vlan eth0.1 and eth0.2; where is the secondary interface or the supposed eth1, any guide for a configuration similar to that of Ubiquiti?

Many devices have just one link between the CPU and the internal switch. In this case, LAN and WAN traffic must be separated using VLANs.

If this is the case, just use eth0.1 and eth0.2 as your interfaces.

1 Like

Thanks for answering
How can I install eth1 to the cpu?

Drivers that abstract the switch out of the picture so to the administrator it looks like there are separate "real" eth ports is called DSA. OpenWrt only uses DSA on a few models. The different configuration scheme here doesn't limit what the hardware actually can do. If you only need two simple untagged ports just refer to them as eth0.1 and eth0.2. If you need VLANs to appear on the Ethernet cable you will need to configure the switch separately.

2 Likes

You cannot, and you do not need it.

1 Like

Please post here the output of uci export network

root@OpenWrt:~# uci export network
package 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 'fda6:806d:19ec::/48'

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

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'

config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'

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

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

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

ifconfig with ubiquiti firmware

WA.v8.4.1# ifconfig
ath0 Link encap:Ethernet HWaddr B4:FB:E4:A4:92:F4
UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:377 overruns:0 carrier:0
collisions:0 txqueuelen:150
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

ath1 Link encap:Ethernet HWaddr B6:FB:E4:A4:92:F4
inet addr:192.168.172.1 Bcast:192.168.172.255 Mask:255.255.255.0
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:12 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

br0 Link encap:Ethernet HWaddr B4:FB:E4:A4:92:F4
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:1134 errors:0 dropped:0 overruns:0 frame:0
TX packets:779 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:96007 (93.7 KiB) TX bytes:318965 (311.4 KiB)

eth0 Link encap:Ethernet HWaddr B4:FB:E4:A5:92:F4
UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:1140 errors:0 dropped:0 overruns:0 frame:0
TX packets:779 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:96283 (94.0 KiB) TX bytes:321219 (313.6 KiB)

eth1 Link encap:Ethernet HWaddr B6:FB:E4:A5:92:F4
UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:38078 (37.1 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wifi0 Link encap:UNSPEC HWaddr B4-FB-E4-A4-92-F4-00-00-00-00-00-00-00-00-00 -00
UP BROADCAST RUNNING MULTICAST MTU:2286 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:778 errors:0 dropped:1424 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:64 Memory:b0000000-b0200000

wifi1 Link encap:UNSPEC HWaddr B6-FB-E4-A4-92-F4-00-48-00-00-00-00-00-00-00 -00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:300 errors:0 dropped:0 overruns:0 frame:0
TX packets:4893 errors:15 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:2 Memory:b8100000-b811ffff

ifconfig with openwrt

root@OpenWrt:~# ifconfig
br-lan Link encap:Ethernet HWaddr B4:FB:E4:A5:92:F4
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::b6fb:e4ff:fea5:92f4/64 Scope:Link
inet6 addr: fda6:806d:19ec::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:698 errors:0 dropped:0 overruns:0 frame:0
TX packets:572 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:98634 (96.3 KiB) TX bytes:183511 (179.2 KiB)

eth0 Link encap:Ethernet HWaddr B4:FB:E4:A5:92:F4
inet6 addr: fe80::b6fb:e4ff:fea5:92f4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:719 errors:0 dropped:0 overruns:0 frame:0
TX packets:675 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:112778 (110.1 KiB) TX bytes:208269 (203.3 KiB)
Interrupt:4

eth0.1 Link encap:Ethernet HWaddr B4:FB:E4:A5:92:F4
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:698 errors:0 dropped:0 overruns:0 frame:0
TX packets:572 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:98634 (96.3 KiB) TX bytes:183511 (179.2 KiB)

eth0.2 Link encap:Ethernet HWaddr B4:FB:E4:A5:92:F4
inet6 addr: fe80::b6fb:e4ff:fea5:92f4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:19422 (18.9 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:116 errors:0 dropped:0 overruns:0 frame:0
TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8063 (7.8 KiB) TX bytes:8063 (7.8 KiB)

In your case:

UBNT	OpenWrt
eth0	eth0.1
eth1	eth0.2

Treat them like this, it is only the name that changed, nothing else.

2 Likes