当我在 CentOS 7.6 中使用此命令启动 wireguard 时:
wg-quick up wg0
显示此错误:
wg-quick: `wg0' already exists
我正在使用ifconfig
命令查看 wg0:
wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420
inet 10.0.0.1 netmask 255.255.255.0 destination 10.0.0.1
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 13 dropped 0 overruns 0 carrier 0 collisions 0
这是我的配置:
[root@izbp19pke6x0v6ruecuy1yz wireguard]# cat wg0.conf
[Interface]
PrivateKey = [redacted]
Address = 10.0.0.1/24
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 7456
[Peer]
PublicKey = Cfrr58B8PjtpZhJzqdFXwpXQOnZedQpOOWjrkeM7p30=
AllowedIPs = 10.0.0.3/24
[Peer]
PublicKey = b3rP/aN53ZY7IwzOWyxfxLEw7atwS2GpFe0kLchHhk4=
AllowedIPs = 10.0.0.2/32
但该过程不存在:
[root@izbp19pke6x0v6ruecuy1yz wireguard]# lsof -i:7456
[root@izbp19pke6x0v6ruecuy1yz wireguard]#
有什么问题,我应该怎么做才能解决它?