Routing question

Hello.
Help.
I don't know how to set it up.

172.16.0.x/24(Lan) <-> Openwrt(172.16.0.1(Lan), 192.168.8.2(WiFi)) <-> Modem (192.168.8.1(WiFi), dhcp (Internet))

I can't find documentation about it.

What are you trying to achieve?

1 Like

Access the Internet from 172.16.0.x via openwrt.
lan<->openwrt<->modem

It should work with the default configuration. Other than the LAN address/subnet, what did you change? Does your problem affect both wireless and wired, or just one of them?

Can you get access to the internet from 192.168.8.0/24?

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
1 Like
**cat /etc/config/dhcp**
config dnsmasq
        option domainneeded     1
        option boguspriv        1
        option filterwin2k      0  # enable for dial on demand
        option localise_queries 1
        option rebind_protection 1  # disable if upstream must serve RFC1918 addresses
        option rebind_localhost 1  # enable for RBL checking and similar services
        #list rebind_domain example.lan  # whitelist RFC1918 responses for domains
        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.auto'
        #list server            '/mycompany.local/1.2.3.4'
        #option nonwildcard     1
        #list interface         br-lan
        #list notinterface      lo
        #list bogusnxdomain     '64.94.110.11'

config dhcp lan
        option interface        lan
        option start    100
        option limit    150
        option leasetime        12h

config dhcp wan
        option interface        wan
        option ignore   1`

**cat /etc/config/wireless**
`config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option hwmode '11ng'
        option path 'platform/ar933x_wmac'
        option htmode 'HT20'
        list ht_capab 'SHORT-GI-20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'RX-STBC1'
        list ht_capab 'DSSS_CCK-40'
        option disabled '0'
        option country 'RU'

config wifi-iface
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option ssid 'ssid_name'
        option key 'ssid_key'
        option encryption 'ssid_enc'

**cat /etc/config/network**
config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd04:aee3:8b36::/48'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option dns '8.8.8.8'
        option ipaddr '172.16.0.1'

config interface 'wwan'
        option proto 'static'
        option gateway '192.168.8.1'
        option netmask '255.255.255.0'
        option dns '8.8.8.8'
        option ipaddr '192.168.8.123'

**cat /etc/config/firewall**
config defaults
    option syn_flood '1'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'lan'
    option network 'lan'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

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

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

There is Internet access from 192.168.8.123

Whatever this is, it is wrong,. Remove it.

If that doesn't fix the problem, please fix the formatting by using the instructions in my previous post -- without the formatting, it is very hard to read.

I have no "option gateway '192.168.1.1'"

I can't figure out how to format the text.

Strange... it was there when I first read it.

Can you go back and reformat the config files... it should look something like this (just an example to show the formatting):

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 'fd8c:9c00:4cad::/48'

config device
	option name 'br-lan'
	option type 'bridge'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '10.0.10.1'

config interface 'wan'
	option proto 'dhcp'
	option device 'eth0'

Alternatively, you could just simply reset the router to defaults, then configure your uplink with a wwan network config and put that network into the wan firewall zone. It should work with just the few minor changes.

1 Like

use the </> button on top of the message window.

1 Like

Thanks for fixing the formatting.

I'm not immediately seeing anything wrong.

If you ssh into the router and run ping tests, what happens:

ping 8.8.8.8
ping google.com

Yes.
Both by name and IP address.

ok... so what about your computer -- what IP address, subnet mask, gateway, and dns is it getting?

Ethernet adapter LAN connection:

    Connection DNS suffix . . . . . : lan
    Description. . . . . . . . . . . . . : Qualcomm Atheros AR8161/8165 PCI-E Gigabi
t Ethernet Controller (NDIS 6.20)
    Physical adress. . . . . . . . . : 60-A4-4C-0A-6D-D6
    DHCP enabled. . . . . . . . . . . : Yes
    Auto tuning is enabled. . . . . . : Yes
    IPv4 address. . . . . . . . . . . . : 172.16.0.146(Main)
    Subnet mask . . . . . . . . . . : 255.255.255.0
    Rent received. . . . . . . . . . : March 1, 2022 04:54:30 PM
    The lease expires. . . . . . . . . . : March 3, 2022 21:58:37
    Main gate. . . . . . . . . : 172.16.0.1
    DHCP server. . . . . . . . . . . : 172.16.0.1
    DNS servers. . . . . . . . . . . : 172.16.0.1
    NetBios over TCP/IP. . . . . . . . : Switched on

That should work. From your computer, what happens if you run the same ping tests?

Do you have another system you can use to test?

C:\Users\admin>ping 8.8.8.8

Packet exchange from 8.8.8.8 to 32 bytes of data:
Timed out request.
Timed out request.
Timed out request.

Ping stats for 8.8.8.8:
    Packets: Sent = 3, Received = 0, Lost = 3
    (100% loss)
Control-C
^C
C:\Users\admin>tracert -d 8.8.8.8

Trace route to 8.8.8.8 with max 30 hops

  1 <1 ms <1 ms <1 ms 172.16.0.1
  2 * * * Query timed out.
  3 * * * Query timed out.
  4 * * * Query timed out.
  5 * * * Query timed out.
  6 * * * Query timed out.

Just to rule out your current system.

I also don't see the second operwrt interface

C:\Users\admin>ping 198.168.8.123

Packet exchange from 198.168.8.123 to 32 bytes of data:
Timed out request.
Timed out request.

Ping stats for 198.168.8.123:
     Packets: Sent = 2, Received = 0, Lost = 2
     (100% loss)
Control-C

can you ping the IPs along the way, on your side of the ISPs device, based on the drawing in your initial post ?

Try another computer.