Dir-320 no wan interface

lan - 4 ports, wan - 1 port

1 Like

See the section:

VLAN explained with default scenario of most LEDE routers

config 'switch' 'eth0'
        option 'reset' '1'
        option 'enable_vlan' '1'

config 'switch_vlan' 'eth0_1'
        option 'device' 'eth0'
        option 'vlan' '1'
        option 'ports' '0 1 3t 5t'

config 'switch_vlan' 'eth0_2'
        option 'device' 'eth0'
        option 'vlan' '2'
        option 'ports' '2 4t 5t'

config 'switch_vlan' 'eth0_3'
        option 'device' 'eth0'
        option 'vlan' '3'
        option 'ports' '3t 4t'

config 'switch_port'
        option 'device' 'eth0'
        option 'port' '3'
        option 'pvid' '3'
#it's config break my router(I'm adding this to the end of /etc/config/network)
  • Because your syntax appears invalid, it also appears you used the improper quote marks:
config switch 'eth0'
	option reset '1'
	option enable_vlan '1'
  • The Underscores in the eth names are likely invalid (e.g., they should be: eth0.1, eth0.2, etc.)
  • I don't see the config for the CPU (all VLANs should likely include "0t")
  • You have VLAN 1 and 2 tagged on port 5, that's usually WAN, and so likely that's invalid
  • Usually VLAN 2 is WAN, it should be configured on that port untagged (on most routers WAN is port 5; but it could be reversed on yours)

Here is a default config:

  • CPU is Port 0
  • LAN (VLAN 1) is on Ports 1-4
  • WAN (VLAN 2) is Port 5
config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'
	option mirror_source_port '0'
	option mirror_monitor_port '0'

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

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

Hope this helps.

tried again, does not work. I noticed that ipv6 is being distributed.

enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:87:2c:60:a0:66 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2a6a:8bf9:eb5d:6ffd/64 scope link 
       valid_lft forever preferred_lft forever

#/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 'fd1f:eeb0:e627::/48'

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

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option mirror_source_port '0'
        option mirror_monitor_port '0'

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

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

What doesn't work???

Of course IPv6 is distributed, you have a ULA specified.

This thread is about setting up the WAN and switch, not IPv6. Are your 4 LAN and 1 WAN ports working???

  • ALSO, YOU DON'T HAVE A WAN SPECIFIED!!

I can not connect to the router (I do not use wifi, because the computer does not have an adapter)

From:

https://wiki.openwrt.org/toh/d-link/dir-320

Switch Ports (for VLANs)

Numbers 1-4 are Ports 1-4 as labeled on the unit, number 0 is the Internet (WAN) on the unit, 5 is the internal connection to the router itself.
Port Switch port
Internet (WAN) 0
LAN 1 1
LAN 2 2
LAN 3 3
LAN 4 4

Therefore:

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

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

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

You must follow the manual!!!

if I add only

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

then all normal

if add switch_vlan .. then fail

Please use CODE BLOCKS. It's extremely difficult to understand what you mean.

So you're saying that you have a LAN and WAN

  • Without specifying a WAN,
  • and without configuring the switch ports

That's makes no sense, but it's excellent for your issue!

If everything now works, please consider adding [SOLVED] to the title.

to create a new topic?

You just stated that everything is normal when you added:

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

So, if everything is fine, your issue is SOLVED, correct???

when adding the next router breaks down

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

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option vid '2'
	option ports '0 5t'
  • DID YOU CREATE WAN YET!?!?
  • Also, is there a reason that your /etc/config/network file was completely empty!?!? A factory reset might fix this:
firstboot
reboot

Interfaces

The default network configuration is:
Interface Name Description Default configuration
br-lan LAN & WiFi 192.168.1.1/24
vlan0 (eth0.0) LAN ports (1 to 4) None
vlan1 (eth0.1) WAN port DHCP
wl0 WiFi Disabled

I have a lan chopped off. or you need to create a wan so lan does not fall?

No clue what that means. If you want assistance, I suggest you just start with setting up a normal LAN and WAN.

I am offering assistance based on this manual:

https://wiki.openwrt.org/toh/d-link/dir-320

If you're trying to make a custom configuration, please do so after your device is working as normal.

Again, did your delete you /etc/config/network at some point???

the wiki says that my Broadcom 5352 processor, and luci shows that BCM5325. On wikidevi Broadcom BCM5354 This is normal?
I used image builder for bcm47xx.(for bcm53xx image builder not exist).
luci does not add a vlan

file exist