
Wireguard VPN 테스트를 작동시키려고 하는데 막혔습니다. 다음에 확인해야 할 사항에 대한 제안을 주시면 감사하겠습니다.
서버는 3.13.0-141 커널로 Ubuntu를 실행하는 DO 드롭릿이고, 클라이언트는 4.4.0-112 커널로 Mint를 실행하는 데스크톱 kvm 게스트이며 nat 라우터 뒤에 브리지된 네트워크 연결입니다. 클라이언트는 서버에 대해 ping을 보낼 수 있지만 다른 패킷 유형은 손실된 것처럼 보이지만 tcpdump는 서버의 wg0에 도착하는 많은 패킷을 보여줍니다. ip_forward 및 Proxy_arp는 제안된 대로 서버에서 활성화됩니다.이 게시물에서. 서버의 ufw에 터널 포트가 열려 있습니다. 서버는 다른 포트에서도 openvpn을 실행하고 있습니다.
이러한 구성 파일과 함께 wg-quick을 사용합니다.
고객:
[Interface]
Address = 10.0.0.200
DNS = 8.8.8.8
PrivateKey = UJeiJJvi5NdqiBrgBfsim+ZS4c69M5EP5fUNNIXMy08=
[Peer]
PublicKey = MreTtFUDB5bQfkegxX2cvz3BLC9sybK4y0loTKhVunU=
AllowedIPs = 0.0.0.0/0
Endpoint = 159.203.227.235:51820
sudo wg-quick up ./wg0.conf
[sudo] password for jim:
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip address add 10.0.0.200 dev wg0
[#] ip link set mtu 1420 dev wg0
[#] ip link set wg0 up
[#] resolvconf -a tun.wg0 -m 0 -x
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
섬기는 사람:
[Interface]
Address = 10.0.0.201
SaveConfig = true
ListenPort = 51820
PrivateKey = 6GBAE7bFjrOfEp1uWiPvoW+5CyfpjsBmK0/vCIWbGl0=
[Peer]
PublicKey = furwAmh4vbKrLAGZG/QDIUT2a1GLi0WxDY6YdQKzIHE=
AllowedIPs = 10.0.0.200/32
sudo wg-quick up ./wg0.conf
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip link set mtu 1420 dev wg0
[#] ip link set wg0 up
[#] ip route add 10.0.0.200/32 dev wg0
ip route show table all
default via 159.203.224.1 dev eth0
10.0.0.200 dev wg0 scope link
10.12.0.0/16 dev eth0 proto kernel scope link src 10.12.0.5
159.203.224.0/20 dev eth0 proto kernel scope link src 159.203.227.235
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
broadcast 10.12.0.0 dev eth0 table local proto kernel scope link src 10.12.0.5
local 10.12.0.5 dev eth0 table local proto kernel scope host src 10.12.0.5
broadcast 10.12.255.255 dev eth0 table local proto kernel scope link src 10.12.0.5
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 159.203.224.0 dev eth0 table local proto kernel scope link src 159.203.227.235
local 159.203.227.235 dev eth0 table local proto kernel scope host src 159.203.227.235
broadcast 159.203.239.255 dev eth0 table local proto kernel scope link src 159.203.227.235
broadcast 172.17.0.0 dev docker0 table local proto kernel scope link src 172.17.0.1
local 172.17.0.1 dev docker0 table local proto kernel scope host src 172.17.0.1
broadcast 172.17.255.255 dev docker0 table local proto kernel scope link src 172.17.0.1
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev veth215195c proto kernel metric 256
fe80::/64 dev docker0 proto kernel metric 256
unreachable default dev lo table unspec proto kernel metric 4294967295 error -101
local ::1 dev lo table local proto none metric 0
local fe80::42:2fff:fec9:400 dev lo table local proto none metric 0
local fe80::601:d8ff:febf:4701 dev lo table local proto none metric 0
local fe80::84ce:13ff:feaf:f628 dev lo table local proto none metric 0
ff00::/8 dev eth0 table local metric 256
ff00::/8 dev veth215195c table local metric 256
ff00::/8 dev docker0 table local metric 256
unreachable default dev lo table unspec proto kernel metric 4294967295 error -101
답변1
나는 이 매우 유용한 도움으로 이 작업을 수행했습니다.블로그 게시물 또한 클라이언트 DNS 트래픽이 터널 외부로 유출되는 것을 방지하기 위해 DNS 서버를 설정하는 방법도 다룹니다.
주요 문제는 서버의 불완전한 필터/nat 설정이었습니다. 이 게시물에서는 필요한 iptables 명령을 다룹니다. ufw는 이미 ssh와 같은 간단한 작업에 사용 중이었고 모든 것을 하나의 형식으로 변환하고 싶지 않았기 때문에 그냥 결합했습니다. 이것은 Ubuntu 16.04를 실행하는 새로운 물방울에 효과적이었습니다. 또한 추가 ufw 규칙을 추가해야 했던 원래 Ubuntu 14.04 시스템에서 테스트했습니다.
ufw 경로는 eth0의 10.200.200.2에서 wg0에 대한 허용을 허용합니다.
어떤 이유로 입력 및 전달에 대한 기본 정책이 DROP으로 설정되었기 때문인 것 같습니다.