RT,
见之前讨论的帖子。v2ex.com/t/800905
现在遇到新的情况,因为在光猫上无法用 wg-quick,有很多命令光猫上没有,所以看了下 wg-quick 脚本,用原始命令直接敲
load hisi tun.ko
insmod /lib/modules/4.4.197/kernel/drivers/net/tun.ko
create wg0 interface
LOG_LEVEL=debug wireguard-go wg0
configuration
#set ip
ip -4 address add 10.0.1.88 dev wg0
#up wg0
ip link set mtu 1280 up dev wg0
#add route, ONLY ALLOW .1 through wg, just for test.
ip -4 route add 10.0.1.1 dev wg0
#set conf
wg setconf wg0 wg0.conf
result
[root@x6 /mnt/jffs2/hw] # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 0.0.0.0 0.0.0.0 U 10 0 0 ppp257
10.0.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 wg0
#ping test on x6
[root@x6 /mnt/jffs2/hw] # ping 10.0.1.1
PING 10.0.1.1 (10.0.1.1): 56 data bytes
64 bytes from 10.0.1.1: seq=0 ttl=64 time=19.197 ms
64 bytes from 10.0.1.1: seq=1 ttl=64 time=20.565 ms
#ping on pc
C:\Users\xxx>ping 10.0.1.1
Pinging 10.0.1.1 with 32 bytes of data: