Basic networking help needed

Hi all:

I'm new to OpenWRT and this is my current configuration:

Router Asus RT-AC56U (BCM4708)
Architecture ARMv7 Processor rev 0 (v7l)
Firmware Version OpenWrt 21.02.1 r16325-88151b8303 / LuCI openwrt-21.02 branch git-21.295.67054-13df80d

I simply want to use OpenWRT for sharing USB attached storage to other hosts on my network. The problem is that I can't get the networking right to make this work. The OpenWRT is using a static IP (10.57.59.10) and the gateway is 10.57.59.1.

I can access the Openwrt web interface from other machines but nothing from the openwrt seems to work. I cannot ping the gateway or internet (100% packet loss) but pinging the localhost does work.

I can ssh into the openwrt also. I know a little about networking and linux but not enough to figure this out with all the VLAN and bridging stuff. I've tried several things like disabling ipv6 to no avail.

Any help with this would be greatly appreciated.

Here is /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'

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 '10.57.59.10'
	option gateway '10.57.59.1'
	list dns '10.57.59.1'
	option ipv6 '0'
	option delegate '0'

config device
	option name 'eth0.2'
	option macaddr '30:5A:3A:a0:07:d1'

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

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 '0 1 2 3 5t'

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

what does /etc/resolv.conf contain ?

This use case will have your router being simply a LAN device which is commonly used to make a wired to wifi bridge known as a "dumb AP." It can also offer services to the LAN such as file sharing.

The upstream network must be plugged into one of the AC56U LAN ports. Do not plug anything into the WAN port. Later you can repurpose that port for something else, but right now the WAN port and network can just be left unused. In /etc/config/dhcp, disable the DHCP server on the lan.

1 Like

/etc/resolv.conf contains:

search lan
nameserver 127.0.0.1
nameserver ::1

How is the router connected to the upstream network? Based on your configuration, it should almost certainly be connected LAN-LAN. If this OpenWrt router is connected via its WAN port, that would explain the issue.

The upstream network is plugged in the AC56U LAN port. DHCP server is disabled on the lan (I think). Here is the /etc/config/dhcp file

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 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'

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

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'

root@OpenWrt:/etc/config# clear
root@OpenWrt:/etc/config# cat /etc/config/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 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'

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

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'

add nameserver 1.1.1.1 to resolv.conf, and name resolution will start working, but setting it like that, doesn't survive a reboot.

Changed resolv.conf but still have problem. I was getting name resolution before.

search lan
nameserver 1.1.1.1
nameserver 127.0.0.1
nameserver ::1

I have determined that the problem is that the gateway in my network is blocking outbound traffic from the openwrt. I corrected this and things are working now. Thanks to those who offered suggestions.

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