此服务器有 2 个 IP 地址,如下所示。
- 11.22.22.44 : 主地址 & 退出 ip 地址
- 11.22.33.55 :二级地址,非退出ip地址,用于openvpn客户端连接
我可以 ssh 到 2 个 IP 地址中的任何一个。
我希望 OpenVPN 客户端通过辅助地址连接到服务器,并将主地址用作 Internet 的出口 IP。
Wed Jun 24 01:33:28 2020 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019
Wed Jun 24 01:33:28 2020 library versions: OpenSSL 1.1.1c 28 May 2019, LZO 2.10
Wed Jun 24 01:33:28 2020 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 24 01:33:28 2020 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Jun 24 01:33:28 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]11.22.33.55:11194
Wed Jun 24 01:33:28 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Wed Jun 24 01:33:28 2020 UDP link local: (not bound)
Wed Jun 24 01:33:28 2020 UDP link remote: [AF_INET]11.22.33.55:11194
Wed Jun 24 01:33:28 2020 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Wed Jun 24 01:34:28 2020 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Wed Jun 24 01:34:28 2020 TLS Error: TLS handshake failed
Wed Jun 24 01:34:28 2020 SIGUSR1[soft,tls-error] received, process restarting
Wed Jun 24 01:34:28 2020 Restart pause, 5 second(s)
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 11.22.00.254 0.0.0.0 UG 0 0 0 eno1
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
11.22.33.0 0.0.0.0 255.255.255.0 U 0 0 0 eno2
11.22.22.0 0.0.0.0 255.255.255.0 U 0 0 0 eno1
如果配置
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 11.22.22.44 网络掩码 255.255.255.0 广播 11.22.22.255 inet6 fe80::a6bf:1ff:fe25:fa37 prefixlen 64 scopeid 0x20 ether a4:bf:01: 25:fa:37 txqueuelen 1000 (以太网) RX 数据包 15354 字节 1618795 (1.5 MiB) RX 错误 0 丢弃 0 溢出 0 帧 0 TX 数据包 15482 字节 2259131 (2.1 MiB) TX 错误 0 丢弃 0 溢出 0 载波 0 冲突 0 设备内存0xa2b00000-a2bffff
eno2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 11.22.33.55 网络掩码 255.255.255.0 广播 11.22.33.255 inet6 fe80::a6bf:1ff:fe25:fa38 prefixlen 64 scopeid 0x20 ether a4:bf:01: 25:fa:38 txqueuelen 1000 (以太网) RX 数据包 0 字节 0 (0.0 B) RX 错误 0 丢弃 0 溢出 0 帧 0 TX 数据包 46 字节 2476 (2.4 KiB) TX 错误 0 丢弃 0 溢出 0 载波 0 冲突 0 设备内存0xa2900000-a29fffff
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000(本地环回)RX数据包242274字节13193252(12.5 MiB)RX错误0丢弃1342 超限 0 帧 0 TX 数据包 242274 字节 13193252 (12.5 MiB) TX 错误 0 丢弃 0 超限 0 载波 0 冲突 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 10.8.0.1 网络掩码 255.255.255.255 目标 10.8.0.2 inet6 fe80::1e70:64bf:9ce5:78b6 prefixlen 64 scopeid 0x20 unspec 00-00- 00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC) RX 数据包 58 字节 7715 (7.5 KiB) RX 错误 0 丢弃 0 溢出 0 帧 0 TX 数据包 78 字节 20953 (20.4 KiB) TX 错误 0 丢弃 0 超限 0 载波 0 冲突 0
连接到辅助地址后出现 TLS 错误(但在主地址上工作)。有没有办法解决这个问题(使用iptables?)