!!!Дело происходит на VPS от google!!! т.е. не на своем компе
При подключении по впн к другому серверу через конфиг ovpn обрывается ssh соединение. Нашел как решить
https://askubuntu.com/questions/1199037/ubuntu-server-and-openvpn-client-ssh-acces
```bash
root@instance-2:/etc/openvpn# ifconfig
ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1460
inet 10.128.0.8 netmask 255.255.255.255 broadcast 0.0.0.0
inet6 fe80::4001:aff:fe80:8 prefixlen 64 scopeid 0x20<link>
ether 42:01:0a:80:00:08 txqueuelen 1000 (Ethernet)
RX packets 689 bytes 136271 (136.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 618 bytes 66911 (66.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 62 bytes 6364 (6.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 62 bytes 6364 (6.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.128.0.1 0.0.0.0 UG 100 0 0 ens4
10.128.0.1 0.0.0.0 255.255.255.255 UH 100 0 0 ens4
ввел
sudo ip rule add from 10.128.0.0/20 table vpnbypass #Allow communication from Subnet
sudo ip rule add to 10.128.0.0/20 table vpnbypass #Allow communication to Subnet
sudo ip route add table vpnbypass to 10.128.0.0/20 dev ens4 #Selecting route for vpnbypass table
sudo ip route add table vpnbypass default via 10.128.0.1 dev ens4 #selecting gateway
Впн коннектится, НЕ выкидывает с сервера…. Но, нет интернета. Например
curl ifconfig.me просто зависает, connection timeout
Вывод OpenVPN
openvpn --config config.ovpn
Sun May 17 19:32:25 2020 WARNING: --ping should normally be used with --ping-restart or --ping-exit
Sun May 17 19:32:25 2020 NOTE: --fast-io is disabled since we are not using UDP
Sun May 17 19:32:25 2020 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sun May 17 19:32:25 2020 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sun May 17 19:32:25 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]23.82.136.161:443
Sun May 17 19:32:25 2020 Socket Buffers: R=[131072->131072] S=[16384->16384]
Sun May 17 19:32:25 2020 Attempting to establish TCP connection with [AF_INET]23.82.136.161:443 [nonblock]
Sun May 17 19:32:26 2020 TCP connection established with [AF_INET]23.82.136.161:443
Sun May 17 19:32:26 2020 TCP_CLIENT link local: (not bound)
Sun May 17 19:32:26 2020 TCP_CLIENT link remote: [AF_INET]23.82.136.161:443
Sun May 17 19:32:26 2020 TLS: Initial packet from [AF_INET]23.82.136.161:443, sid=3b90eac0 c0691244
Sun May 17 19:32:26 2020 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sun May 17 19:32:26 2020 VERIFY OK: depth=2, C=PA, O=NordVPN, CN=NordVPN Root CA
Sun May 17 19:32:26 2020 VERIFY OK: depth=1, C=PA, O=NordVPN, CN=NordVPN CA4
Sun May 17 19:32:26 2020 VERIFY KU OK
Sun May 17 19:32:26 2020 Validating certificate extended key usage
Sun May 17 19:32:26 2020 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Sun May 17 19:32:26 2020 VERIFY EKU OK
Sun May 17 19:32:26 2020 VERIFY OK: depth=0, CN=us3202.nordvpn.com
Sun May 17 19:32:26 2020 Control Channel: TLSv1.2, cipher TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384, 4096 bit RSA
Sun May 17 19:32:26 2020 [us3202.nordvpn.com] Peer Connection Initiated with [AF_INET]23.82.136.161:443
Sun May 17 19:32:27 2020 SENT CONTROL [us3202.nordvpn.com]: 'PUSH_REQUEST' (status=1)
Sun May 17 19:32:28 2020 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 103.86.96.100,dhcp-option DNS 103.86.99.100,sndbuf 524288,rcvbuf 524288,explicit-exit-notify,comp-lzo no,route-gateway 10.7.0.1,topology subnet,ping 60,ping-restart 180,ifconfig 10.7.0.5 255.255.255.0,peer-id 0,cipher AES-256-GCM'
Sun May 17 19:32:28 2020 OPTIONS IMPORT: timers and/or timeouts modified
Sun May 17 19:32:28 2020 OPTIONS IMPORT: --explicit-exit-notify can only be used with --proto udp
Sun May 17 19:32:28 2020 OPTIONS IMPORT: compression parms modified
Sun May 17 19:32:28 2020 OPTIONS IMPORT: --sndbuf/--rcvbuf options modified
Sun May 17 19:32:28 2020 Socket Buffers: R=[131072->425984] S=[87040->425984]
Sun May 17 19:32:28 2020 OPTIONS IMPORT: --ifconfig/up options modified
Sun May 17 19:32:28 2020 OPTIONS IMPORT: route options modified
Sun May 17 19:32:28 2020 OPTIONS IMPORT: route-related options modified
Sun May 17 19:32:28 2020 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sun May 17 19:32:28 2020 OPTIONS IMPORT: peer-id set
Sun May 17 19:32:28 2020 OPTIONS IMPORT: adjusting link_mtu to 1659
Sun May 17 19:32:28 2020 OPTIONS IMPORT: data channel crypto options modified
Sun May 17 19:32:28 2020 Data Channel: using negotiated cipher 'AES-256-GCM'
Sun May 17 19:32:28 2020 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sun May 17 19:32:28 2020 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sun May 17 19:32:28 2020 ROUTE_GATEWAY 10.128.0.1
Sun May 17 19:32:28 2020 TUN/TAP device tun0 opened
Sun May 17 19:32:28 2020 TUN/TAP TX queue length set to 100
Sun May 17 19:32:28 2020 /sbin/ip link set dev tun0 up mtu 1500
Sun May 17 19:32:28 2020 /sbin/ip addr add dev tun0 10.7.0.5/24 broadcast 10.7.0.255
Sun May 17 19:32:28 2020 /sbin/ip route add 23.82.136.161/32 via 10.128.0.1
Sun May 17 19:32:28 2020 /sbin/ip route add 0.0.0.0/1 via 10.7.0.1
Sun May 17 19:32:28 2020 /sbin/ip route add 128.0.0.0/1 via 10.7.0.1
Sun May 17 19:32:28 2020 Initialization Sequence Completed
root@instance-2:~# ping ya.ru ping: ya.ru: Temporary failure in name resolution
root@instance-2:~# curl ifconfig.me
и тишина…
Что я делаю не так? Я новичек, как работает маршрутизиация понимаю смутно, не кидайте камнями ;)