Need help! Configuring Archer C6 with Access Points and VLANs

Hello everyone!

I am trying to configure my network as following:

Main router (Archer C6 V2) behind a Fritzbox as modem. This main rounter should provide firewall, dns and dhcp. This works at the moment.

My first access point (Archer C6 V2 as well) should provide wired and wireless connections for clients for all three vlans I use (lan, guest and iot). Trying to connect to one of the wlans, I get no ip address. When connecting a wired security cam to any port of the access point, the access point is not accessable anymore. The diagnosis also shows I also cant ping local or www.

traceroute: can't connect to remote host (192.168.1.1): Permission denied
/etc/config/network

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

config globals 'globals'
        option ula_prefix ''

config device
        option name 'br-lan'
        option type 'bridge'
        option stp '1'
        list ports 'eth0.1'
        list ports 'eth0.4'

config interface 'lan'
        option device 'br-lan.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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

config interface 'wan6'
        option device '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 '0t 2 3 5t'
        option vid '1'
        option description 'LAN'

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

config interface 'iot'
        option proto 'static'
        option device 'br-iot.3'
        option ipaddr '192.168.3.1'
        option netmask '255.255.255.0'

config bridge-vlan
        option device 'br-lan'
        option vlan '1'
        list ports 'eth0.1'
        list ports 'eth0.4:t'

config bridge-vlan
        option device 'br-lan'
        option vlan '3'
        list ports 'eth0.1:t'
        list ports 'eth0.4:t'

config bridge-vlan
        option device 'br-lan'
        option vlan '4'
        list ports 'eth0.1:t'
        list ports 'eth0.4:t'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0t 2t 3t 4 5t'
        option vid '3'
        option description 'IOT'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option ports '0t 2t 3t 5t'
        option vid '4'
        option description 'Gast'

config device
        option type 'bridge'
        option name 'br-iot'
        list ports 'eth0.3'

config bridge-vlan
        option device 'br-iot'
        option vlan '3'
        list ports 'eth0.3'

config device
        option type 'bridge'
        option name 'br-gast'
        option bridge_empty '1'
        option stp '1'

config bridge-vlan
        option device 'br-gast'
        option vlan '4'

config interface 'gast'
        option proto 'static'
        option device 'br-gast.4'
        option ipaddr '192.168.4.1'
        option netmask '255.255.255.0'
        option broadcast '192.168.4.255'
        list dns '192.168.4.1'

The firewall for the main router looks like

config defaults
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'
        option drop_invalid '1'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        list device 'br-lan.1'
        list device 'phy1-ap0'
        list device 'radio0.network1'
        list network 'lan'

config zone
        option name 'wan'
        option input 'DROP'
        option output 'ACCEPT'
        option forward 'DROP'
        option masq '1'
        option mtu_fix '1'
        list network 'wan'
        list network 'wan6'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config zone
        option name 'iot'
        option input 'DROP'
        option output 'ACCEPT'
        option forward 'DROP'
        list device 'br-iot.3'
        list device 'eth0.3'
        list device 'phy1-ap1'
        list network 'iot'

config forwarding
        option src 'iot'
        option dest 'wan'

config rule
        option name 'Allow-DNS-DHCP-lan'
        option src 'lan'
        option dest_port '53 67 68'
        option target 'ACCEPT'
        list proto 'tcp'
        list proto 'udp'

config rule
        option name 'Allow-DNS-DHCP-iot'
        option src 'iot'
        option dest_port '53 67 68'
        option target 'ACCEPT'
        list proto 'tcp'
        list proto 'udp'

config zone
        option name 'gast'
        option input 'DROP'
        option output 'ACCEPT'
        option forward 'DROP'
        list device 'phy1-ap2'
        list device 'br-gast.4'
        list network 'gast'

config forwarding
        option src 'gast'
        option dest 'wan'

config forwarding
        option src 'lan'
        option dest 'iot'

config rule
        option name 'Allow-DNS-DHCP-gast'
        option src 'gast'
        option dest_port '53 67 68'
        option target 'ACCEPT'

The network config of the access point is

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

config globals 'globals'
        option ula_prefix ''

config device
        option name 'br-lan'
        option type 'bridge'
        option stp '1'
        list ports 'eth0.1'
        list ports 'eth0.4'

config interface 'lan'
        option device 'br-lan.1'
        option proto 'static'
        option ipaddr '192.168.1.3'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.1.1'
        list dns '192.168.1.1'
        option broadcast '192.168.1.1'

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

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

config interface 'iot'
        option proto 'static'
        option device 'br-iot.3'
        option ipaddr '192.168.3.3'
        option netmask '255.255.255.0'
        option gateway '192.168.3.1'
        option broadcast '192.168.3.255'
        list dns '192.168.3.1'

config interface 'gast'
        option proto 'static'
        option device 'br-gast.4'
        option ipaddr '192.168.4.3'
        option netmask '255.255.255.0'
        option gateway '192.168.4.1'
        option broadcast '192.168.4.255'
        list dns '192.168.4.1'

config bridge-vlan
        option device 'br-lan'
        option vlan '1'
        list ports 'eth0.1'
        list ports 'eth0.4:t'

config bridge-vlan
        option device 'br-lan'
        option vlan '3'
        list ports 'eth0.1:t'
        list ports 'eth0.4:t'

config bridge-vlan
        option device 'br-lan'
        option vlan '4'
        list ports 'eth0.1:t'
        list ports 'eth0.4:t'

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

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option ports '0t 1t 2t 5t'
        option vid '4'
        option description 'Gast'

config device
        option type 'bridge'
        option name 'br-iot'
        list ports 'br-iot.3'
        option stp '1'
        option bridge_empty '1'

config bridge-vlan
        option device 'br-iot'
        option vlan '3'
        list ports 'br-iot.3'

config device
        option type 'bridge'
        option name 'br-gast'
        list ports 'br-gast.4'
        option bridge_empty '1'
        option stp '1'

config bridge-vlan
        option device 'br-gast'
        option vlan '4'
        list ports 'br-gast.4:t'

The access point has firewall, dhcp and dns disabled in start up menu. The vlans have the same names, the same passwords and the same mobility domain.

Thank you for your help very much!

Best regards
Melli

Both of these devices have major configuration errors. You'll be best served by resetting and starting over.

From there, we'll build out one additional network, verify that it works as expected, and then you can copy the recipe to create the rest.

Let's start with the main router -- once it is reset, post the configs and we'll advise about creating new networks.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Thank you for your reply.

I resetted the main router to factory reset. I did nothing else than login via ssh and copying the config files you have asked for.

The result is

system board

{
        "kernel": "5.15.137",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "TP-Link Archer C6 v2 (EU/RU/JP)",
        "board_name": "tplink,archer-c6-v2",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "ath79/generic",
                "description": "OpenWrt 23.05.2 r23630-842932a63d"
        }
}

network:

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

config globals 'globals'
        option ula_prefix ''

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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

config interface 'wan6'
        option device '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 3 4 5 0t'

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

wireless:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/ahb/18100000.wmac'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option disabled '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

DHCP

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

firewall

config defaults
        option syn_flood        1
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  00
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.16.235
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:
#       option src_port 80
#       option dest             wan
#       option dest_ip  
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  
#       option dest_port        120
#       option proto    tcp

Great.

I'd recommend upgrading to the latetst (23.05.3) but that is not a big deal.

Let's add your iot network first.
Starting with the network config file... I don't know the mapping of logical to physical ports, but I think that logical port 5 corresponds to physical port 4. For now, we'll make that the trunk port (i.e. the port that carries multiple networks for connection to the AP). I'll also guess that logical port 4 corresponds to physical port 3 -- we'll use this port to prove the iot network is working as expected with ethernet. We can re-assign the ports should these be the wrong assumptions and/or you want to allocate them differently.

With that in mind, let's start with the switch...
remove port 4 from VLAN 1:

Then add a new VLAN for the iot network with port 4 untagged and port 5 tagged (and port 0 tagged -- that's the CPU)

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

Now add a bridge device that references that new VLAN and a network stanza using that device.

config device
        option name 'br-iot'
        option type 'bridge'
        list ports 'eth0.3'

config interface 'iot'
        option proto 'static'
        option device 'br-iot'
        option ipaddr '192.168.3.1'
        option netmask '255.255.255.0'

EDIT: I have corrected the device for the network interface to be br-iot (it was erroneously br-iot.3)

In your DHCP file, add a DHCP server for the new network.

config dhcp 'iot'
        option interface 'iot'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'

And now in the firewall file, we'll add a new iot zone with the following properties:

  • forwarding from iot > wan allowed
  • forwarding from lan > iot allowed
  • restrict the iot network from accessing the router except for dns and dhcp
config zone
        option name 'iot'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        list network 'iot'

config rule
        option name 'Allow-DNS-DHCP-iot'
        option src 'iot'
        option dest_port '53 67 68'
        option target 'ACCEPT'
        list proto 'tcp'
        list proto 'udp'

config forwarding
        option src 'iot'
        option dest 'wan'

config forwarding
        option src 'lan'
        option dest 'iot'

Now, you can also add an SSID to your wireless file and connect it with the iot network.

Restart this router and test. You will be able to get an address on the iot network (192.168.3.0/24) by plugging your computer (via ethernet) into one of the lan ports -- hopefully lan 3, but I might have that wrong, so try each port if that doesn't work.

Report back on the status.

Hello psherman,

I did what you told me to do. But I think I made a mistake. Wired connection is working for both, lan and iot. But when I try to connect to my ssids instead of using the cable. I can only connect to my lan and having internet but not to my iot. The connection is established but no internet connection. Should I repost network and wireless config?

Thank you very much for your help!

Best regards
Melli

Let's see the updated configs for network, dhcp, firewall, and wireless.

Hey psherman,

the config is

network:

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

config globals 'globals'
        option ula_prefix ''

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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

config interface 'wan6'
        option device '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 3 5 0t'

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

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

config device
        option name 'br-iot'
        option type 'bridge'
        list ports 'eth0.3'

config interface 'iot'
        option proto 'static'
        option device 'br-iot.3'
        option ipaddr '192.168.3.1'
        option netmask '255.255.255.0'
        option type 'bridge'

config bridge-vlan
        option device 'br-iot'
        option vlan '3'
        list ports 'eth0.3'

firewall

config defaults
        option syn_flood        1
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  00
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.16.235
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp

config zone
        option name 'iot'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        list network 'iot'

config rule
        option name 'Allow-DNS-DHCP-iot'
        option src 'iot'
        option dest_port '53 67 68'
        option target 'ACCEPT'
        list proto 'tcp'
        list proto 'udp'

config forwarding
        option src 'iot'
        option dest 'wan'

config forwarding
        option src 'lan'
        option dest 'iot'

dhcp:

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config dhcp 'iot'
        option interface 'iot'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'

wireless:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/ahb/18100000.wmac'
        option channel '1'
        option band '2g'
        option legacy_rates '1'
        option cell_density '0'
        option country 'DE'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'Maeuse'
        option encryption 'psk-mixed'
        option key ''
        option ieee80211r '1'
        option nasid '0001'
        option mobility_domain '4f57'
        option ft_over_ds '0'
        option ft_psk_generate_local '1'

config wifi-iface 'wifinet2'
        option device 'radio1'
        option mode 'ap'
        option ssid 'Maeuse-iot'
        option encryption 'psk-mixed'
        option key ''
        option ieee80211r '1'
        option nasid '0001'
        option mobility_domain '4f57'
        option ft_over_ds '0'
        option ft_psk_generate_local '1'
        option wpa_disable_eapol_key_retries '1'
        option network 'iot'

Thank you!

I see that I made a mistake in my post (now corrected)... change the device in this section to simply br-iot. Also, remove the bridge line -- that will break the interface.

This next section should be deleted (this was not something I said should be added to the file):

Regarding your SSID configuration:

I highly discourage the use of 802.11r unless there is a demonstrated need for it. Many devices (especially iot/embedded) do not play well with this standard.

In addition, the psk-mixed should not be used. Stick with wpa2 encrpytion.

Once you've made those changes, reboot and try again.

Thank you, you are really fast! I am so happy!

Now the wifi iot is connecting to the internet as well. The network config is now as you told me. I disabled 802.11r and changed the encryption.

Great. Now we can move on to the other device.... make sure it's been reset to defaults. All of this happens on the AP (not the main router).

Since it's also a C6v2, we can use the default configuration you posted earlier as a reference.

First, change the lan address so that it doesn't conflict with the main router. For example:

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.2'
        option netmask '255.255.255.0'

We'll now repeat the process adding vlan 3 (for now, just on logical port 5 as a tagged network -- so assuming that I was correct that it corresponds to physical port 4, you'll connect both routers together via port 4), and a bridge:

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

config device
        option name 'br-iot'
        option type 'bridge'
        list ports 'eth0.3'

Now we can add the network interface, but this time it will be unmanaged:

config interface 'iot'
        option proto 'none'
        option device 'br-iot'

And the last thing we need to do is to disable the lan DHCP server on the AP. Edit the lan dhcp server so that it looks like this:

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ignore '1'

Now, restart the AP and connect using port 4 on each device and then test.

Sorry for the delay. My grandpa called from the hospital and needed some stuff.

When I tried to config the access point the wifi of the main router stopped working. I will reboot and try to enable wifi again. After rebooting, wifi is working, but I cant get an ip address on the third port when I am connected via wire to the mainrouter.

let's see the config files from the AP.

So its working. I get the right IPs on wifi and using a wire on the access point. Could you help me configuring the guest vlan as well?

And could I setup a second access point the same way? I need to use powerline adapter - because we have no cabel into our backyard/garden.

dhcp:


config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option cachesize '1000'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'
	option filter_aaaa '0'
	option filter_a '0'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	option ra_slaac '1'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ignore '1'

network


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

config globals 'globals'
	option ula_prefix 

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.2'
        option netmask '255.255.255.0'

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

config interface 'wan6'
	option device '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 3 4 5 0t'

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

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

config device
        option name 'br-iot'
        option type 'bridge'
        list ports 'eth0.3'

config interface 'iot'
        option proto 'none'
        option device 'br-iot'

firewall

config defaults
	option syn_flood	1
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

config zone
	option name		lan
	list   network		'lan'
	option input		ACCEPT
	option output		ACCEPT
	option forward		ACCEPT

config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
	option masq		1
	option mtu_fix		1

config forwarding
	option src		lan
	option dest		wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
config rule
	option name		Allow-Ping
	option src		wan
	option proto		icmp
	option icmp_type	echo-request
	option family		ipv4
	option target		ACCEPT

config rule
	option name		Allow-IGMP
	option src		wan
	option proto		igmp
	option family		ipv4
	option target		ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
	option name		Allow-DHCPv6
	option src		wan
	option proto		udp
	option dest_port	546
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-MLD
	option src		wan
	option proto		icmp
	option src_ip		fe80::/10
	list icmp_type		'130/0'
	list icmp_type		'131/0'
	list icmp_type		'132/0'
	list icmp_type		'143/0'
	option family		ipv6
	option target		ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Input
	option src		wan
	option proto	icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	list icmp_type		router-solicitation
	list icmp_type		neighbour-solicitation
	list icmp_type		router-advertisement
	list icmp_type		neighbour-advertisement
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Forward
	option src		wan
	option dest		*
	option proto		icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-IPSec-ESP
	option src		wan
	option dest		lan
	option proto		esp
	option target		ACCEPT

config rule
	option name		Allow-ISAKMP
	option src		wan
	option dest		lan
	option dest_port	500
	option proto		udp
	option target		ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	00:
#	option target	REJECT

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80
#	option proto		tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#	option src		wan
#	option src_dport	22001
#	option dest		lan
#	option dest_port	22
#	option proto		tcp

### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp

wireless:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/ahb/18100000.wmac'
        option channel '1'
        option band '2g'
        option legacy_rates '1'
        option cell_density '0'
        option country 'DE'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'Maeuse'
        option encryption 'psk2'
        option key ''
        option wpa_disable_eapol_key_retries '1'

config wifi-iface 'wifinet2'
        option device 'radio1'
        option mode 'ap'
        option ssid 'Maeuse-iot'
        option encryption 'psk2'
        option wpa_disable_eapol_key_retries '1'
        option network 'iot'
        option key ''

Thank you so much!

It appears that you added a new lan dhcp stanza, rather than editing the one that was there. As a result, you have two.... delete this one:

Logical port 4 (I think physical port 3) is included as untagged in both VLAN 1 and VLAN 3. That is not allowed. If you want the iot network on physical port 3 of the AP, remove logical port 4 from VLAN 1 below. Or, if you only want those to be regular lan ports, remove logical port 4 from VLAN 3.

Restart when you're done with that and test again.

Seems to work! I get IPs and can connect to the internet so far.

I would love to add a guest network to both router, main and access point. Could you advise me how to do this?

I am very grateful for your support!

Yes. You'll basically follow the same general formula as we did for the iot network. Do you want to give it a shot and then have me review?

Yes... but....

This may or may not work. It depends on the powerline adapter and its behavior with tagged networks/VLANs. But you can try, yes. Let's get your guest network operating first, then we'll make an adjustment or two for the 3rd ap to hopefully work.

Good morning psherman,

I created a guest network with an empty bridge and connected successfully using wireless lan. I also connected the access point in the basement while the main router is connected to the Fritzbox directly in the second floor.

All wlans are working and the ports are working as wanted as well.

So this is the new config:

network:


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

config globals 'globals'
        option ula_prefix ''

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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

config interface 'wan6'
        option device '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 '0t 2 3 5'
        option vid '1'

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

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

config device
        option name 'br-iot'
        option type 'bridge'
        list ports 'eth0.3'

config interface 'iot'
        option proto 'static'
        option device 'br-iot'
        option ipaddr '192.168.3.1'
        option netmask '255.255.255.0'

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

config device
        option type 'bridge'
        option name 'br-gast'
        option bridge_empty '1'

config interface 'gast'
        option proto 'static'
        option device 'br-gast'
        option ipaddr '192.168.4.1'
        option netmask '255.255.255.0'

in the firewall config I added


config forwarding
        option src 'gast'
        option dest 'wan'

config rule
        option name 'Allow-DNS-DHCP-gast'
        option src 'gast'
        option dest_port '53 67 68'
        option target 'ACCEPT'
        list proto 'tcp'
        list proto 'udp'

in the dhcp part:


config dhcp 'gast'
        option interface 'gast'
        option start '100'
        option limit '150'
        option leasetime '12h'

wireless:

config wifi-iface 'wifinet3'
        option device 'radio1'
        option mode 'ap'
        option ssid 'Maeuse-Gast'
        option encryption 'psk2'
        option key ''
        option wpa_disable_eapol_key_retries '1'
        option network 'gast'

I thank you very much for review my guest addition. I hope its well configured. My server is working with the attached vlans. I am really happy! I couldnt thank you enough! You are a hero!

All looks good!

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

Thank you very much!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.