Using
- OpenWrt 23.05.0 on Linksys WRT3200ACM
Goal
- I want to be able from remote locations to access my LAN at home; previously I used openvpn for that, but I now want to use Wireguard to do this
Situation
-
ISP router
- 192.168.2.254
-
openwrt router
- 192.168.2.253 (WAN interface)
- 192.168.1.1 (internally)
-
I managed to configure Wireguard so that I can setup a tunnel from my Iphone. Iphone says "VPN". But I cannot reach any site, neither in my LAN, nor in the internet when the wireguard connection is active.
-
I suspect that my firewall config is the problem. Below you find my /etc/config/firewall file. I have "playing" with the wireguard interface in a separate zone, and in the 'lan' zone, but without any result.
All help is welcome
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 input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list network 'wan6'
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 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 src 'wan'
option proto 'udp'
option dest_port '1194'
option family 'ipv4'
option target 'ACCEPT'
option name 'OpenVPNupd1194'
option enabled '0'
config rule
option name 'OpenVPNtcp443'
option src 'wan'
option target 'ACCEPT'
list proto 'tcp'
option dest_port '443'
option family 'ipv4'
option enabled '0'
config rule
option name 'Support-UDP-Traceroute'
option src 'wan'
option dest_port '33434:33689'
option proto 'udp'
option family 'ipv4'
option target 'REJECT'
option enabled '0'
config include
option path '/etc/firewall.user'
config redirect
option target 'DNAT'
option name 'GTD'
list proto 'tcp'
option src 'wan'
option src_dport '5000'
option dest 'lan'
option dest_port '4001'
option dest_ip '192.168.1.15'
config redirect
option target 'DNAT'
option name 'ncp'
list proto 'tcp'
option src 'wan'
option src_dport '80'
option dest 'lan'
option dest_ip '192.168.1.15'
option dest_port '80'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'ncps'
option src 'wan'
option src_dport '443'
option dest_port '443'
option dest_ip '192.168.1.15'
config rule
option name 'wireguard'
option src 'wan'
option dest_port '51820'
option target 'ACCEPT'
list proto 'udp'
config zone
option name 'wireguard'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'wireguard'
config forwarding
option src 'wireguard'
option dest 'lan'
and /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 'fd79:b69f:3db8::/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.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'wan'
option macaddr '26:f5:a2:c5:9f:48'
config interface 'wan'
option device 'wan'
option proto 'static'
option ipaddr '192.168.2.253'
option netmask '255.255.255.0'
option gateway '192.168.2.254'
list dns '192.168.2.254'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config interface 'wireguard'
option proto 'wireguard'
option network 'lan'
option private_key 'REPLACED'
option listen_port '51820'
config wireguard_wireguard
option description 'Basios2'
option public_key 'REPLACED'
option private_key 'REPLACE'
option endpoint_host 'myhomeurl.com'
option endpoint_port '51820'
option route_allowed_ips '1'
config wireguard_wireguard
option public_key 'REPLACED'
option private_key 'REPLACED'
option description 'metallowedips'
list allowed_ips '10.0.0.0/32'
option route_allowed_ips '1'
option endpoint_host 'myhomeurl.com'