Hi all,
I am trying to setup my routers in the following setup.
My target is to let clients on router 2 and router 3 to have access to the internet but not to each other. From what I have read port 4 of routers 2 and 3 need to act as a trunk.
I got the port numbers from using
swconfig list
Found: switch0 - rt305x
swconfig dev rt305x show
The output of the above is:
Global attributes:
enable_vlan: 1
alternate_vlan_disable: 0
bc_storm_protect: 0
led_frequency: 0
Port 0:
disable: 0
doubletag: 0
untag: 1
led: 5
lan: 0
recv_bad: 0
recv_good: 21858
tr_bad: 0
tr_good: 13855
pvid: 0
link: port:0 link:up speed:100baseT full-duplex
Port 1:
disable: 0
doubletag: 0
untag: 1
led: 5
lan: 1
recv_bad: 0
recv_good: 0
tr_bad: 0
tr_good: 0
pvid: 0
link: port:1 link:down
Port 2:
disable: 0
doubletag: 0
untag: 1
led: 5
lan: 1
recv_bad: 0
recv_good: 0
tr_bad: 0
tr_good: 0
pvid: 0
link: port:2 link:down
Port 3:
disable: 0
doubletag: 0
untag: 1
led: 5
lan: 1
recv_bad: 0
recv_good: 0
tr_bad: 0
tr_good: 0
pvid: 0
link: port:3 link:down
Port 4:
disable: 0
doubletag: 0
untag: 1
led: 5
lan: 1
recv_bad: 0
recv_good: 17605
tr_bad: 0
tr_good: 26459
pvid: 0
link: port:4 link:up speed:100baseT full-duplex
Port 5:
disable: 1
doubletag: 0
untag: 1
led: ???
lan: 1
recv_bad: 0
recv_good: 0
tr_bad: 0
tr_good: 0
pvid: 0
link: port:5 link:down
Port 6:
disable: 0
doubletag: 0
untag: 0
led: ???
lan: ???
recv_bad: ???
recv_good: ???
tr_bad: ???
tr_good: ???
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex
VLAN 0:
ports: 0 1 2 3 4 5 6t
I am assuming port 6 is the cpu port as it is the only 1000baseT connection.
The out of
swconfig dev rt305x show
is
switch0: rt305x(rt305x-esw), ports: 7 (cpu @ 6), vlans: 4096
--switch
Attribute 1 (int): enable_vlan (VLAN mode (1:enabled))
Attribute 2 (int): alternate_vlan_disable (Use en_vlan instead of doubletag to disable VLAN mode)
Attribute 3 (int): bc_storm_protect (Global broadcast storm protection (0:Disable, 1:64 blocks, 2:96 blocks, 3:128 blocks))
Attribute 4 (int): led_frequency (LED Flash frequency (0:30mS, 1:60mS, 2:240mS, 3:480mS))
Attribute 5 (none): apply (Activate changes in the hardware)
Attribute 6 (none): reset (Reset the switch)
--vlan
Attribute 1 (ports): ports (VLAN port mapping)
--port
Attribute 1 (int): disable (Port state (1:disabled))
Attribute 2 (int): doubletag (Double tagging for incoming vlan packets (1:enabled))
Attribute 3 (int): untag (Untag (1:strip outgoing vlan tag))
Attribute 4 (int): led (LED mode (0:link, 1:100m, 2:duplex, 3:activity, 4:collision, 5:linkact, 6:duplcoll, 7:10mact, 8:100mact, 10:blink, 11:off, 12:on))
Attribute 5 (int): lan (HW port group (0:wan, 1:lan))
Attribute 6 (int): recv_bad (Receive bad packet counter)
Attribute 7 (int): recv_good (Receive good packet counter)
Attribute 8 (int): tr_bad (Transmit bad packet counter. rt5350 only)
Attribute 9 (int): tr_good (Transmit good packet counter. rt5350 only)
Attribute 10 (int): pvid (Primary VLAN ID)
Attribute 11 (unknown): link (Get port link information)
This is my current config on router 2 in openwrt:
/etc/config/network
config globals 'globals'
option ula_prefix 'fd3e:beea:bf91::/48'
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.53.30'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.53.1'
list dns '192.168.53.1'
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/10300000.wmac'
option channel '11'
option band '2g'
option htmode 'HT40'
option cell_density '0'
option country 'MT'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'R08-MR-2.4'
option encryption 'psk2'
option key '*'
config wifi-device 'radio1'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
option channel '124'
option band '5g'
option htmode 'VHT80'
option cell_density '0'
option txpower '23'
option country 'ZA'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'R08-MR-5.0'
option encryption 'psk2'
option key '*'
/etc/config/dhcp
config dnsmasq
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option cachesize '1000'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
list server '192.168.11.1'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ignore '0'
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'
/etc/config/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
My first issue is that I cannot separate the WAN port from the two LAN ports. This should be possible as the stock firmware worked that way.
I tried replacing
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.53.30'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.53.1'
list dns '192.168.53.1'
with
config interface 'lan'
option ifname 'eth0.1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.53.1'
option netmask '255.255.255.0'
config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'
but the router will then become inaccessible from all ports
I also tried enabling the switch menu in openwrt with:
config switch_port
option device 'switch0'
option disable '0'
config switch_vlan
option device 'switch0'
option vlan '0'
option vid '0'
option ports '0 1 2 3 4 5 6t'
but the switch menu on luci complains with switch unknown topology.