Hi all,
This is a continuation from the thread: 2nd Openwrt router connected to 1st can't ping ipv4 addresses
We completed making a simple routing configuration between two different openwrt routers with their own subnet. Everything works as expected. Now the last thing I am trying to figure out is how to allow the 2nd router to see the hostnames established by the first.
For example, if I navigate to V-Matrix2.lan on router 2 (it's hostname), I am brought to the luci page. But if I navigate to V-Matrix3 (Hostname for router 1), it is unable to find it. But if I navigate to the ip address of router 1, I am then brought to the luci page of router 1 (V-Matrix3). So the goal is to be able to navigate to hostnames established by router 1, from router 2, strongly preferred to be automated if possible after configurations are complete as I have some ideas in mind on how I would achieve this manually using the Hostnames setting under "DHCP and DNS" in the network section of Openwrt.
As far as I can tell just from that section, Router 1 is passing information on all active connections to router 2, which I thought was pretty cool, as when I select the dropdown, all the active ip addresses tied to a device from router 1 immediately come up, so I see all 3.0 and 4.0 subnet addresses.
A reminder about the configuration of the two routers is as follow:
Google Fiber to Openwrt Router 1[V-Matrix3] (Connected to Wan port)
Openwrt Router 1 to Openwrt Router 2[V-Matrix2] (Connected from Lan1 to Wan Respectively)
V-Matrix3 uses subnet x.x.4.0, has static route for subnet 3.0 to router 2
V-Matrix2 uses subnet x.x.3.0
With the exception of the configurations done from the previous thread, static leases, and simple administrative customizations, these openwrt routers are vanilla installs so no extra packages OR super complex configurations as of now. Here is also some config info commonly requested when trying to get help:
Router 1 [V-Matrix3]
***********************
*ubus call system board*
***********************
root@V-Matrix3:~# ubus call system board
{
"kernel": "6.1.79",
"hostname": "V-Matrix3",
"system": "ARMv8 Processor rev 4",
"model": "Dynalink DL-WRX36",
"board_name": "dynalink,dl-wrx36",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "SNAPSHOT",
"revision": "r25389-fe0081eecf",
"target": "qualcommax/ipq807x",
"description": "OpenWrt SNAPSHOT r25389-fe0081eecf"
}
}
*************************
*cat /etc/config/network*
*************************
root@V-Matrix3:~# cat /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 'fd1d:47a8:9295::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.4.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config route
option interface 'lan'
option target '192.168.3.0/24'
option gateway '192.168.4.252'
**************************
*cat /etc/config/firewall*
**************************
root@V-Matrix3:~# cat /etc/config/firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
option flow_offloading '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 redirect
option dest 'lan'
option target 'DNAT'
option name 'V-Frame Website (HTTP)'
list proto 'tcp'
option src 'wan'
option src_dport '80'
option dest_ip '192.168.4.2'
option dest_port '82'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'V-Frame Website (HTTPs)'
list proto 'tcp'
option src 'wan'
option src_dport '443'
option dest_ip '192.168.4.2'
option dest_port '8084'
**********************
*cat /etc/config/dhcp*
**********************
root@V-Matrix3:~# cat /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 cachesize '1000'
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 host
option name 'V-Frame'
option ip *Redacted*
list mac *Redacted*
config host
option ip *Redacted*
list mac *Redacted*
config host
option name *Redacted*
option ip *Redacted*
list mac *Redacted*
config host
option name *Redacted*
option ip *Redacted*
list mac *Redacted*
config host
option name 'V-Matrix2'
option duid *Redacted*
list mac *Redacted*
option ip *Redacted*
Router 2 [V-Matrix2]
***********************
*ubus call system board*
***********************
root@V-Matrix2:~# ubus call system board
{
"kernel": "6.1.80",
"hostname": "V-Matrix2",
"system": "ARMv8 Processor rev 4",
"model": "Dynalink DL-WRX36",
"board_name": "dynalink,dl-wrx36",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "SNAPSHOT",
"revision": "r25398-d40d64fc62",
"target": "qualcommax/ipq807x",
"description": "OpenWrt SNAPSHOT r25398-d40d64fc62"
}
}
*************************
*cat /etc/config/network*
*************************
root@V-Matrix2:~# cat /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 'fd74:2c31:edd4::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.3.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
**************************
*cat /etc/config/firewall*
**************************
root@V-Matrix2:~# cat /etc/config/firewall
config defaults
option input 'REJECT'
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'
option masq '1'
config zone
option name 'Router'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'wan'
list network 'wan6'
config forwarding
option src 'lan'
option dest 'Router'
config forwarding
option src 'Router'
option dest 'lan'
**********************
*cat /etc/config/dhcp*
**********************
root@V-Matrix2:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option rebind_protection '1'
option rebind_localhost '1'
option domain 'lan'
option expandhosts '1'
option cachesize '1000'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option localservice '1'
option ednspacket_max '1232'
option localise_queries '1'
option authoritative '1'
option local '/lan/'
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 host
option name *Redacted*
option duid *Redacted*
list mac *Redacted*
option ip '*Redacted*'
Edit 1: Initial Corrections