VPN アップリンク経由でルーティングされる - パケットがトンネルを通過しない

VPN アップリンク経由でルーティングされる - パケットがトンネルを通過しない

ホームサーバーとリモートサーバー間のVPNトンネルを介してホームLANとリモートLANの間をルーティングしたいと思います。設定は次のとおりです。

                       _________________                                   _____________                                    __________________
              ________|                 |______                  _________|             |________                __________|                  |
             |        |                 |      |                |         |             |        |              |          |                  |
Remote-LAN---| enp1s0 |  remote-server  | tun1 |---VPN-Tunnel---| uplink0 | home server | enp2s0 |---Home-LAN---| Ethernet | Windows Notebook |
             |________|                 |______|                |_________|             |________|              |__________|                  |
                      |_________________|                                 |_____________|                                  |__________________|

リモートサーバー

相互作用

enp1s0: 192.168.178.10/24
tun1: 10.11.0.2/24

路線

default via 192.168.178.1 dev enp1s0 proto static
10.11.0.0/24 dev tun1 proto kernel scope link src 10.11.0.2
172.23.56.0/24 via 10.11.0.1 dev tun1
192.168.178.0/24 dev enp1s0 proto kernel scope link src 192.168.178.10

ルーティングが有効になりました。

# cat /etc/sysctl.d/30-ipforward.conf
net.ipv4.ip_forward=1

ファイアウォール

-A ufw-user-input -i tun1 -j ACCEPT

ホームサーバー

相互作用

enp2s0: 172.23.56.2/24
uplink0: 10.11.0.1/24

路線

default via 172.23.56.254 dev enp2s0 proto static
10.11.0.0/24 dev uplink0 proto kernel scope link src 10.11.0.1
172.23.56.0/24 dev enp2s0 proto kernel scope link src 172.23.56.2
192.168.178.0/24 via 10.11.0.2 dev uplink0

ルーティングが有効

$ cat /etc/sysctl.d/routing.conf
net.ipv4.ip_forward = 1

ファイアウォール

table inet filter {
        chain input {
                type filter hook input priority 0; policy accept;
                ct state { established, related } accept
                ct state invalid drop
                iifname "lo" accept
                ip protocol icmp accept
                ip6 nexthdr ipv6-icmp accept
                iifname "enp2s0" tcp dport ssh accept
                tcp dport { http, https } accept
                udp dport { openvpn, 1195 } accept
                iifname "game0" jump game-vpn
                reject
        }

        chain game-vpn {
                tcp dport 25565 accept
        }

        chain forward {
                type filter hook forward priority 0; policy accept;
                ip saddr 172.23.56.0/24 ip daddr 192.168.178.0/24 accept
                ip saddr 192.168.178.0/24 ip daddr 172.23.56.0/24 accept
                drop
        }

        chain output {
                type filter hook output priority 0; policy accept;
        }
}

ノートブック(Windows 10)

相互作用

Ethernet: 172.23.56.20

路線

192.168.178.0    255.255.255.0      172.23.56.2     172.23.56.20     51

残念ながら、私のラップトップからリモートLANにpingをすると

ping 192.168.178.10

タイムアウトが発生します。エコー要求が転送され、ホームサーバーのVPNインターフェイスに到達するようです。

$ sudo tcpdump -i uplink0 "host 172.23.56.20"
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on uplink0, link-type RAW (Raw IP), capture size 262144 bytes
21:03:56.651706 IP gamebook.fritz.box > 192.168.178.10: ICMP echo request, id 1, seq 265, length 40
21:04:01.284635 IP gamebook.fritz.box > 192.168.178.10: ICMP echo request, id 1, seq 266, length 40
21:04:06.289546 IP gamebook.fritz.box > 192.168.178.10: ICMP echo request, id 1, seq 267, length 40

ただし、リモートVPNインターフェイスには接続できません。

tcpdump -i tun1 "host 172.23.56.20"
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun1, link-type RAW (Raw IP), capture size 262144 bytes
<a whole lotta nothing>

私は何を見逃していますか? NATを使用したくなく、通常のIPv4ルーティングのみを使用したいと思います。

ベストアンサー1

おすすめ記事