OpenWRT on RPi-B+ -- How to enable access to ip adresses on the 'wan' side of network


This is how my home network is like.

I am using Raspberry Pi model B+ with a USB to Ethernet adapter for wired connections (no wifi).
I am able to get internet in Network 2 (which. for the time being is only one computer).
When I scan the network on the computer on Network2 with say Angry ip scanner, I can see only the computer in Network2 and the RPi B+. The ip addresses of devices on Network1 or the Wifi router are not found.
How to configure OpenWRT so that I can get access to them?
e.g. - From Network1 I can explore the web interface of the Fiberoptic modem, but from Network 2 I cannot explore the web interface of the wifi modem.

the various configuration files -

root@OpenWrt:~# 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 'fd55:e1b6:bf5e::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	option mtu '1500'
	option txqueuelen '1000'
	option macaddr 'B8:27:EB:8B:2C:DC'
	list ports 'eth0'
	list ports 'eth1'

config interface 'lan'
	option proto 'static'
	option device 'eth1'
	option ipaddr '192.168.0.1'
	option netmask '255.255.0.0'

config interface 'wan'
	option proto 'dhcp'
	option device 'eth0'
root@OpenWrt:~# 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 odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

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

config dhcp 'eth0'
	option interface 'eth0'

config dhcp 'lan'
	option start '100'
	option leasetime '12h'
	option limit '150'
	option interface 'lan'
root@OpenWrt:~# cat /etc/config/firewall

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

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

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

config forwarding
	option dest 'lan'

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

It looks like you have added the WAN port (eth0) to the bridge that does not look right to me.

This also looks redundant

In addition to what @egc said...

This is incorrect. For a /24 network it should be 255.255.255.0. You have defined lan as a /16 network which means it won't route to other 192.168 subnets properly.

The syntax option ipaddr '192.168.0.1/24' is also acceptable. When defining the network this way, omit the netmask line.

2 Likes

removed these. Thanks

Thanks mk24, It worked.

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