I have a Phicomm K3 router and an iPhone, both of which have WireGuard installed. I hope that the external network can access the home network resources at home through WireGuard, but connect fails, and the log shows that the handshake cannot be successful. Here are some information:
Router wireguard infomation:
kmod-wireguard - 4.14.180+1.0.20200506-1
luci-app-wireguard - git-20.186.82389-282dbf8-1
wireguard - 1.0.20200611-1
wireguard-tools - 1.0.20191226-1
Router wireguard config:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 123.113.8.1 0.0.0.0 UG 0 0 0 pppoe-wan
10.0.0.0 * 255.255.255.0 U 0 0 0 br-lan
10.0.1.0 * 255.255.255.0 U 0 0 0 wg
10.0.1.2 * 255.255.255.255 UH 0 0 0 wg
123.113.8.1 * 255.255.255.255 UH 0 0 0 pppoe-wan
/etc/config/network
config interface 'wg'
option proto 'wireguard'
option listen_port '50000'
list addresses '10.0.1.1/24'
option private_key 'GLi6D7tl6RFozkXQ9r8bXUkSnoKBgjg2fOWIgPRWuk4='
option mtu '1280'
config wireguard_wg
option route_allowed_ips '1'
option description 'IOS'
list allowed_ips '10.0.1.2/32'
option public_key '4FgkmfYtGKcjHq/RRlqgJZWXhz+pzEqMUX6s+vBKMXI='
/etc/config/firewall
config forwarding
option dest 'lan'
option src 'wg'
config forwarding
option dest 'wg'
option src 'lan'
config zone
option name 'wg'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option network 'wg'
config rule
option dest_port '50000'
option src 'wan'
option name 'Allow-WG'
option target 'ACCEPT'
Iphone wireguard config
iphone wireguar log:
2020-07-06 14:12:18.133
[NET] peer(tlC4…GQVw) - Sending handshake initiation
2020-07-06 14:12:23.357
[NET] peer(tlC4…GQVw) - Handshake did not complete after 5 seconds, retrying (try 2)
2020-07-06 14:12:23.357
[NET] peer(tlC4…GQVw) - Sending handshake initiation
2020-07-06 14:12:28.394
[NET] peer(tlC4…GQVw) - Handshake did not complete after 5 seconds, retrying (try 3)
2020-07-06 14:12:28.395
[NET] peer(tlC4…GQVw) - Sending handshake initiation
tcpdump -i any -vvn udp port 50000
tcpdump: listening on any, link-type LINUX_SLL (Linux cooked v1), capture size 262144 bytes
06:16:07.600932 IP (tos 0x0, ttl 58, id 13277, offset 0, flags [none], proto UDP (17), length 176)
114.242.250.179.43251 > 123.113.12.89.50000: [udp sum ok] UDP, length 148
06:16:07.606137 IP (tos 0x88, ttl 64, id 50587, offset 0, flags [none], proto UDP (17), length 120)
123.113.12.89.50000 > 114.242.250.179.43251: [bad udp cksum 0xf5e5 -> 0x7b94!] UDP, length 92
06:16:12.770942 IP (tos 0x0, ttl 58, id 29105, offset 0, flags [none], proto UDP (17), length 176)
114.242.250.179.43251 > 123.113.12.89.50000: [udp sum ok] UDP, length 148
06:16:12.776206 IP (tos 0x88, ttl 64, id 51089, offset 0, flags [none], proto UDP (17), length 120)
123.113.12.89.50000 > 114.242.250.179.43251: [bad udp cksum 0xf5e5 -> 0x026e!] UDP, length 92
it show the router can receive the handshake 148byte messge from wan interface, and send 92byte message through lo interface, but the ios client not received this. ( looks like the wg interface doesn't work?)
and the wg interface dropped many packages:
wg Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.0.1.1 P-t-P:10.0.1.1 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MTU:1420 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:58 errors:4526 dropped:39438 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3700 (3.6 KiB) TX bytes:7184 (7.0 KiB)
Some one can help me?