私はNetwork Managerを使用してUbuntuのOpenVPNサーバーに接続しています。接続は正しく確立されていますが、VPNサーバーのIPを間違ったインターフェイスにルーティングするルートが作成されています。
default via 192.168.101.1 dev enxc8f750d7f457 proto dhcp src 192.168.101.212 metric 100
107.152.8.72 via 192.168.101.1 dev enxc8f750d7f457 proto static metric 50
172.16.0.0/12 dev vpn0 proto static scope link metric 50
not needed and incorrect >>>> 172.16.140.182 via 192.168.101.1 dev enxc8f750d7f457 proto static metric 50 <<<<
172.28.12.0/24 dev vpn0 proto kernel scope link src 172.28.12.117 metric 50
192.168.101.0/24 dev enxc8f750d7f457 proto kernel scope link src 192.168.101.212 metric 100
192.168.101.1 dev enxc8f750d7f457 proto static scope link metric 50
192.168.140.0/24 via 192.168.141.1 dev tun0 proto static metric 50
192.168.141.0/24 dev tun0 proto kernel scope link src 192.168.141.2 metric 50
パスを手動で削除すると、すべてが正常です。また、コマンドラインでopenvpnを実行するとパスが生成されず、すべてが正常です。
default via 192.168.101.1 dev enxc8f750d7f457 proto dhcp src 192.168.101.212 metric 100
107.152.8.72 via 192.168.101.1 dev enxc8f750d7f457 proto static metric 50
172.16.0.0/12 dev vpn0 proto static scope link metric 50
172.28.12.0/24 dev vpn0 proto kernel scope link src 172.28.12.117 metric 50
192.168.101.0/24 dev enxc8f750d7f457 proto kernel scope link src 192.168.101.212 metric 100
192.168.101.1 dev enxc8f750d7f457 proto static scope link metric 50
192.168.140.0/24 via 192.168.141.1 dev tun0
192.168.141.0/24 dev tun0 proto kernel scope link src 192.168.141.2
コメントで要求されたように、これはnmcli
開始前のopenvpn接続の出力です。
***1 VPN connection
master enxc8f750d7f457, VPN
inet4 172.28.12.114/24
route4 172.16.0.0/12 metric 50
route4 172.28.12.0/24 metric 50
inet6 fe80::b0fd:7457:8bb9:645a/64
route6 fe80::/64 metric 256
enxc8f750d7f457: connected to Dock (DHCP)
"Realtek RTL8153"
ethernet (r8152), C8:F7:50:D7:F4:57, hw, mtu 1500
ip4 default
inet4 192.168.101.212/24
route4 default via 192.168.101.1 metric 100
route4 192.168.101.0/24 metric 100
route4 192.168.101.1/32 metric 50
route4 107.152.8.72/32 via 192.168.101.1 metric 50
inet6 fe80::9f9c:d780:b443:a93c/64
route6 fe80::/64 metric 1024
lo: connected (externally) to lo
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
inet4 127.0.0.1/8
inet6 ::1/128
route6 ::1/128 metric 256
vpn0: connected (externally) to vpn0
"vpn0"
tun, sw, mtu 1390
inet4 172.28.12.114/24
route4 172.16.0.0/12 metric 50
route4 172.28.12.0/24 metric 50
inet6 fe80::b0fd:7457:8bb9:645a/64
route6 fe80::/64 metric 256
wlo1: disconnected
"Intel Cannon Lake PCH CNVi"
3 connections available
wifi (iwlwifi), 04:EA:56:3A:81:67, autoconnect, hw, mtu 1500
p2p-dev-wlo1: disconnected
"p2p-dev-wlo1"
wifi-p2p, hw
eno2: unavailable
"Intel I219-LM"
ethernet (e1000e), C8:F7:50:5D:7B:CE, hw, mtu 1500
DNS configuration:
servers: 172.16.5.50 172.16.6.50
interface: vpn0
type: vpn
servers: 192.168.101.1
domains: home
interface: enxc8f750d7f457
...後....
***2 VPN connection
master enxc8f750d7f457, VPN
inet4 192.168.141.2/24
route4 192.168.141.0/24 metric 50
route4 192.168.140.0/24 via 192.168.141.1 metric 50
inet6 fe80::ac80:5ff7:3635:5611/64
route6 fe80::/64 metric 256
***1 VPN connection
master enxc8f750d7f457, VPN
inet4 172.28.12.114/24
route4 172.16.0.0/12 metric 50
route4 172.28.12.0/24 metric 50
inet6 fe80::b0fd:7457:8bb9:645a/64
route6 fe80::/64 metric 256
enxc8f750d7f457: connected to Dock (DHCP)
"Realtek RTL8153"
ethernet (r8152), C8:F7:50:D7:F4:57, hw, mtu 1500
ip4 default
inet4 192.168.101.212/24
route4 default via 192.168.101.1 metric 100
route4 192.168.101.0/24 metric 100
route4 192.168.101.1/32 metric 50
route4 107.152.8.72/32 via 192.168.101.1 metric 50
route4 172.16.140.182/32 via 192.168.101.1 metric 50
inet6 fe80::9f9c:d780:b443:a93c/64
route6 fe80::/64 metric 1024
lo: connected (externally) to lo
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
inet4 127.0.0.1/8
inet6 ::1/128
route6 ::1/128 metric 256
tun0: connected (externally) to tun0
"tun0"
tun, sw, mtu 1500
inet4 192.168.141.2/24
route4 192.168.141.0/24 metric 50
route4 192.168.140.0/24 via 192.168.141.1 metric 50
inet6 fe80::ac80:5ff7:3635:5611/64
route6 fe80::/64 metric 256
vpn0: connected (externally) to vpn0
"vpn0"
tun, sw, mtu 1390
inet4 172.28.12.114/24
route4 172.16.0.0/12 metric 50
route4 172.28.12.0/24 metric 50
inet6 fe80::b0fd:7457:8bb9:645a/64
route6 fe80::/64 metric 256
wlo1: disconnected
"Intel Cannon Lake PCH CNVi"
3 connections available
wifi (iwlwifi), 04:EA:56:3A:81:67, autoconnect, hw, mtu 1500
p2p-dev-wlo1: disconnected
"p2p-dev-wlo1"
wifi-p2p, hw
eno2: unavailable
"Intel I219-LM"
ethernet (e1000e), C8:F7:50:5D:7B:CE, hw, mtu 1500
DNS configuration:
servers: 172.16.5.50 172.16.6.50
interface: vpn0
type: vpn
servers: 192.168.101.1
domains: home
interface: enxc8f750d7f457
それが正確に何を意味するのか、どのように設定したのかはわかりませんがmaster enxc8f750d7f457, VPN
、そうであればより正確になりますmaster vpn0, VPN
。 ***2 VPN接続は***1 VPN接続内にあります。