OpenWrt & Wireguard - No Access to Internal IPs

I did, no luck - still cannot access 10.0.0.113

Contrary to that, I can access 10.0.0.113 from my laptop (10.0.0.101) which is connected to my Wifi.

Huh???

This is the same network, this should work.

To be clear, where are you testing the iPhone from?

  • Laptop: connected via (internal) Wifi to the router (10.0.0.1)

  • Raspberry (10.0.0.113): connected to internal Wifi

  • iPhone: external LTE network, connected to the router's WG interface - I can access 10.0.0.1, but not 10.0.0.113

I know it's weird. As I said in my first post, has been bothering me and driving me crazy for weeks now, I am clueless.

Not weird. Turn off masquerade on WG firewall zone. The phone currently only sees 10.0.0.1.

Still no luck, please see firewall zones and phone config below.

  • I thought you were told to remove the duplicate DNS server?
  • Do you have a static route configured in the OpenWrt for 10.0.1.0/24 pointing toward the WG interface?
config route
	option interface 'wg0'
	option target '10.0.1.0'
	option netmask '255.255.255.0'

Sorry! :fearful:
I missed the post that said to remove the DNS. I did so now, no change.

I put the route config part into /etc/config/network and issued /etc/init.d/network restart after that.

Again, no change.

Btw, I am disconnecting and reconnecting to WG from the phone after each config change to be on the safe side.

Shouldn't the netmask be 255.255.255.0?

No, doesn't make a difference.

  • Yes, 255.255.255.0
  • Can you start showing us the results of your tests?
  • Can we see the results of the WG command?

Also, can you verify the IP of your phone, as this config differs from your iPhone picture (which says 10.0.1.3)

Please explain what you mean by "showing us the results of your tests"? None of your suggestion (for which I am very grateful) worked. I think I tried all of your suggestions so far.

Do you want me to post logs? If so, please tell me which.

Also, please tell me what WG command you want me to issue.

Regarding "list allowed_ips '10.0.1.2/32'" - that's a good catch! When trying to strip down the config for posting, I removed all but one of the peers. I have both of them in my full config, with the proper keys:


config interface 'wg0'
	option proto 'wireguard'
	option private_key 'xxx'
	option listen_port '1195'
	list addresses '10.0.1.1/24'

config wireguard_wg0
	option public_key 'xxx'
	option route_allowed_ips '1'
	option persistent_keepalive '25'
	list allowed_ips '10.0.1.2/32'

config wireguard_wg0
	option public_key 'xxx'
	option persistent_keepalive '25'
	list allowed_ips '10.0.1.3/32'

config wireguard_wg0
	option public_key 'xxx'
	list allowed_ips '10.0.1.4/32'
	option route_allowed_ips '1'
	option persistent_keepalive '25'

config wireguard_wg0
	option public_key 'xxx'
	list allowed_ips '10.0.1.5/32'
	option route_allowed_ips '1'
	option persistent_keepalive '25'

The output of the following would be useful:

  • complete /etc/config/network (remove the keys from WG)
  • complete /etc/config/firewall
  • output (from the command line) of the command: wg show (again, remove keys)
  • results from ping tests on your iPhone (screen grabs okay) -- hopefully you have a ping tool (if not, get one from the app store). Pings of interest will be 10.0.1.1, 10.0.0.1, 10.0.0.113, 8.8.8.8, and google.com.
1 Like

I agree with @psherman to see the configs and outputs - as now you're showing 4 peers in your config. Also to verify, I surmise you created a Private Key for each peer?

Also, you have this on a few peers; but and omitted on others. I suggest removing those and using the blanket 10.0.1.0/24 static route instead.

That firewall coloring is bizarre. This is mine:

First of all: thank you so much for your kind patience everybody, I really appreciate it :slight_smile:

  • /etc/config/network
root@OpenWrt> config$ cat 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 'fdcb:1ef1:f209::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '10.0.0.1'
	option ip6assign '60'
	option dns '8.8.8.8 8.8.4.4'
	option ifname 'eth0.1'
	option netmask '255.255.255.0'

config device 'lan_dev'
	option name 'eth0.1'
	option macaddr ''

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_dev'
	option name 'eth0.2'
	option macaddr ''

config interface 'wan6'
	option ifname '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 '1 2 3 4 6t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0 6t'

config interface '8372'
	option proto 'dhcp'
	option ifname 'eth1'

config interface 'wg0'
	option proto 'wireguard'
	option private_key ''
	option listen_port '1195'
	list addresses '10.0.1.1/24'

config wireguard_wg0
	option public_key ''
	option route_allowed_ips '1'
	option persistent_keepalive '25'
	list allowed_ips '10.0.1.2/32'

config wireguard_wg0
	option public_key ''
	option persistent_keepalive '25'
	list allowed_ips '10.0.1.3/32'

config wireguard_wg0
	option public_key ''
	list allowed_ips '10.0.1.4/32'
	option route_allowed_ips '1'
	option persistent_keepalive '25'

config wireguard_wg0
	option public_key ''
	list allowed_ips '10.0.1.5/32'
	option route_allowed_ips '1'
	option persistent_keepalive '25'

config route
	option interface 'wg0'
	option target '10.0.1.0'
	option netmask '255.255.255.0'
  • /etc/config/firewall
root@OpenWrt> config$ cat firewall

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

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

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

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 src_ip 'fc00::/6'
	option dest_ip 'fc00::/6'
	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 rule
	option target 'ACCEPT'
	option proto 'udp'
	option name 'Allow-OpenVPN'
	option dest_port '1194'
	option src 'wan'
	option enabled '0'

config rule
	option src '*'
	option target 'ACCEPT'
	option proto 'udp'
	option name 'Allow-WireGuard'
	option dest_port '1195'

config include
	option path '/etc/firewall.user'

config zone
	option forward 'REJECT'
	option output 'ACCEPT'
	option name 'wireguard'
	option input 'ACCEPT'
	option network 'wg0'
	option mtu_fix '1'

config forwarding
	option dest 'wan'
	option src 'wireguard'

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

config forwarding
	option dest 'wireguard'
	option src 'lan'

config forwarding
	option dest 'lan'
	option src 'wireguard'
  • wg show
root@OpenWrt> config$ wg show
interface: wg0
  public key: (hidden)
  private key: (hidden)
  listening port: 1195

peer: (hidden)
  endpoint: (hidden):63569
  allowed ips: 10.0.1.3/32
  latest handshake: 10 seconds ago
  transfer: 2.15 MiB received, 4.58 MiB sent
  persistent keepalive: every 25 seconds

peer: (hidden)
  allowed ips: 10.0.1.2/32
  persistent keepalive: every 25 seconds

peer: (hidden)
  allowed ips: 10.0.1.4/32
  persistent keepalive: every 25 seconds

peer: (hidden)
  allowed ips: 10.0.1.5/32
  persistent keepalive: every 25 seconds
  • ping 10.0.0.1 (this and all following pings are from the iPhone while connected to WG)
PING 10.0.0.1 (10.0.0.1)
44 bytes from 10.0.0.1 : icmp_seq=0 ttl=64 time=170 ms
44 bytes from 10.0.0.1 : icmp_seq=1 ttl=64 time=76 ms
44 bytes from 10.0.0.1 : icmp_seq=2 ttl=64 time=74 ms
44 bytes from 10.0.0.1 : icmp_seq=3 ttl=64 time=104 ms
44 bytes from 10.0.0.1 : icmp_seq=4 ttl=64 time=633 ms
--- 10.0.0.1 ping statistics ---
5 packets transmitted, 5 packets received, lost 0.0 %
  • ping 10.0.1.1
PING 10.0.1.1 (10.0.1.1)
44 bytes from 10.0.1.1 : icmp_seq=0 ttl=64 time=82 ms
44 bytes from 10.0.1.1 : icmp_seq=1 ttl=64 time=131 ms
44 bytes from 10.0.1.1 : icmp_seq=2 ttl=64 time=87 ms
44 bytes from 10.0.1.1 : icmp_seq=3 ttl=64 time=213 ms
44 bytes from 10.0.1.1 : icmp_seq=4 ttl=64 time=113 ms
44 bytes from 10.0.1.1 : icmp_seq=5 ttl=64 time=76 ms
--- 10.0.1.1 ping statistics ---
6 packets transmitted, 6 packets received, lost 0.0 %
  • ping 10.0.0.113
PING 10.0.0.113 (10.0.0.113)
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
--- 10.0.0.113 ping statistics ---
5 packets transmitted, 0 packets received, lost 100.0 %
  • ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8)
44 bytes from 8.8.8.8 : icmp_seq=0 ttl=52 time=664 ms
44 bytes from 8.8.8.8 : icmp_seq=1 ttl=52 time=106 ms
44 bytes from 8.8.8.8 : icmp_seq=2 ttl=52 time=111 ms
44 bytes from 8.8.8.8 : icmp_seq=3 ttl=52 time=596 ms
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 4 packets received, lost 20.0 %

44 bytes from 8.8.8.8 : icmp_seq=4 ttl=52 time=523 ms

Yes, I did.

Thanks for pointing out that glitch, I activated "route_allowed_ips" for this peer as well, still not working.

How exactly would I change to "blanket 10.0.1.0/24 static route"?

I just set up the zones and the forwarding etc, the coloring was done by OpenWrt (I guess).

See above.

(Be sure to use 255.255.255.0, as you already pointed out.)

Do you have any other devices/hosts on the 10.0.0.0/24 network that you can try to ping? The fact that you can ping the router @ 10.0.0.1 and the Google DNS server (internet at 8.8.8.8) suggests to me that there are no routing or connectivity issues.

I'm wondering if the route is really necessary. What happens if you remove this?

Also, you might try restarting the whole router just to make sure everything gets initialized properly.