Hi! I'm starting to learn about networking and OpenWrt. I set up a network with 4 subnets (lan, trusted, iot and guest), which was fairly simple and straight forward. Then I created a mesh following this guide which also worked perfectly fine (I had to change the CT drivers for non-CT but other than that no issue at all). Now I'm trying to follow the Batman implementation to get it working with all my subnets using this guide but I'm running into some problems.
-
batctl is not showing some commands,
batctl -h
shows an incomplete list from what I've seen everywhere else and things likebatctl o
andbatctl ping
are not recognized.
-
bat0.x devices associated to corresponding bridges do not give any IP to the corresponding interfaces.
-
I can see from the mesh gateway an IP address on the mesh node, but I can't reach it without a wired connection from LAN to LAN between the two devices.
-
If I connect with a wire to the mesh node, I can't reach the mesh gateway. I could when I followed the first guide, without batman
Here are my configurations on the mesh gateway:
/etc/config/dhcp
config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
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 'trusted'
option interface 'trusted'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'iot'
option interface 'iot'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'guest'
option interface 'guest'
option start '100'
option limit '150'
option leasetime '12h'
/etc/config/firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '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'
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 'trusted'
option output 'ACCEPT'
option forward 'REJECT'
option input 'REJECT'
list network 'trusted'
config zone
option name 'iot'
option output 'ACCEPT'
option forward 'REJECT'
option input 'REJECT'
list network 'iot'
config zone
option name 'guest'
option output 'ACCEPT'
option forward 'REJECT'
option input 'REJECT'
list network 'guest'
config forwarding
option src 'lan'
option dest 'iot'
config forwarding
option src 'lan'
option dest 'trusted'
config forwarding
option src 'trusted'
option dest 'wan'
config forwarding
option src 'guest'
option dest 'wan'
config rule
option name 'Allow-DNS-Trusted'
list proto 'tcp'
option src 'trusted'
option dest_port '53'
option target 'ACCEPT'
config rule
option name 'Allow-DHCP-Trusted'
list proto 'udp'
option src 'trusted'
option dest_port '67 68'
option target 'ACCEPT'
config rule
option name 'Allow-DNS-IoT'
list proto 'tcp'
option src 'iot'
option dest_port '53'
option target 'ACCEPT'
config rule
option name 'Allow-DHCP-IoT'
list proto 'udp'
option src 'iot'
option dest_port '67 68'
option target 'ACCEPT'
config rule
option name 'Allow-DNS-Guest'
list proto 'tcp'
option src 'guest'
option dest_port '53'
option target 'ACCEPT'
config rule
option name 'Allow-DHCP-Guest'
list proto 'udp'
option src 'guest'
option dest_port '67 68'
option target 'ACCEPT'
/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 'fd20:7d18:2a95::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.0.1'
option defaultroute '0'
config device
option name 'eth0.2'
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 vid '1'
option ports '0t 2 3 4'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 1'
option vid '2'
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '3'
option ports '0t 5t'
config switch_vlan
option device 'switch0'
option vlan '4'
option vid '4'
option ports '0t 5t'
config switch_vlan
option device 'switch0'
option vlan '5'
option ports '0t'
option vid '5'
config device
option type 'bridge'
option name 'br-trusted'
list ports 'eth0.3'
config device
option type 'bridge'
option name 'br-iot'
list ports 'eth0.4'
config device
option type 'bridge'
option name 'br-guest'
list ports 'eth0.5'
config interface 'trusted'
option proto 'static'
option device 'br-trusted'
option ipaddr '172.16.0.1'
option netmask '255.255.255.0'
option defaultroute '0'
config interface 'iot'
option proto 'static'
option device 'br-iot'
option ipaddr '172.17.0.1'
option netmask '255.255.255.0'
option defaultroute '0'
config interface 'guest'
option proto 'static'
option device 'br-guest'
option ipaddr '10.0.0.1'
option netmask '255.255.255.0'
option defaultroute '0'
config interface 'bat0'
option proto 'batadv'
option routing_algo 'BATMAN_IV'
option bridge_loop_avoidance '1'
option gw_mode 'server'
option hop_penalty '30'
option defaultroute '0'
config interface 'batmesh'
option proto 'batadv_hardif'
option master 'bat0'
option defaultroute '0'
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0'
option band '5g'
option country 'AR'
option cell_density '0'
option htmode 'VHT80'
option channel '60'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/ahb/18100000.wmac'
option band '2g'
option htmode 'HT20'
option country 'AR'
option cell_density '0'
option channel '8'
config wifi-iface 'wifinet1'
option device 'radio1'
option mode 'mesh'
option encryption 'sae'
option mesh_id 'mesh2'
option mesh_fwding '0'
option mesh_rssi_threshold '0'
option key 'MeshPassword'
option network 'batmesh'
config wifi-iface 'wifinet2'
option device 'radio0'
option mode 'ap'
option ssid 'LAN'
option encryption 'psk2'
option key 'LanPassword'
option ieee80211r '1'
option mobility_domain '1234'
option ft_over_ds '0'
option ft_psk_generate_local '1'
option network 'lan'
config wifi-iface 'wifinet3'
option device 'radio1'
option mode 'ap'
option ssid 'IOT'
option encryption 'psk2'
option key 'IoTPassword'
option ieee80211r '1'
option mobility_domain '2345'
option ft_over_ds '0'
option ft_psk_generate_local '1'
option network 'iot'
config wifi-iface 'wifinet4'
option device 'radio1'
option mode 'ap'
option ssid 'GUEST'
option encryption 'psk2'
option isolate '1'
option key 'GuestPassword'
option ieee80211r '1'
option mobility_domain '3456'
option ft_over_ds '0'
option ft_psk_generate_local '1'
option network 'guest'
Here are my configurations on the mesh node (firewall, dnsmasq and odhcpd are disabled here):
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 'fd53:eaa9:85f2::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
list ports 'eth0.2'
list ports 'bat0.1'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
option defaultroute '0'
config device
option name '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 '2 3 4 5 0t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '1 0t'
config interface 'iot'
option proto 'dhcp'
option device 'br-iot'
option defaultroute '0'
config interface 'guest'
option device 'br-guest'
option proto 'dhcp'
option defaultroute '0'
config interface 'bat0'
option proto 'batadv'
option routing_algo 'BATMAN_IV'
option bridge_loop_avoidance '1'
option hop_penalty '30'
option gw_mode 'off'
option defaultroute '0'
config interface 'batmesh'
option proto 'batadv_hardif'
option master 'bat0'
option defaultroute '0'
config device
option type 'bridge'
option name 'br-iot'
list ports 'bat0.4'
config device
option type 'bridge'
option name 'br-guest'
list ports 'bat0.5'
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0'
option band '5g'
option country 'AR'
option cell_density '0'
option channel '40'
option htmode 'VHT40'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/ahb/18100000.wmac'
option band '2g'
option htmode 'HT20'
option channel '8'
option cell_density '0'
option country 'AR'
config wifi-iface 'wifinet0'
option device 'radio1'
option mode 'mesh'
option encryption 'sae'
option mesh_id 'mesh2'
option mesh_fwding '0'
option mesh_rssi_threshold '0'
option key 'MeshPassword'
option network 'batmesh'
I apologize if the terminology I'm using is confusing and incorrect, I'm of course willing to clarify and do my best to better communicate and answer anything that causes confusion.
Thanks!