https://debian.pro/1578 -> описание того что делаю.
Между двумя сервера работает. Попробовал передать ip внутрь kvm vm -> не получилось.
На сервере доноре /etc/network/interfaces
auto tun0
iface tun0 inet static
address 192.168.0.1
netmask 255.255.255.255
pointopoint 148.251.225.166
mtu 1350
pre-up /sbin/ip tunnel add tun0 mode ipip remote 151.80.92.205 local 144.76.60.108 dev eth0
post-down /sbin/ip tunnel del tun0
Пакеты доходят
tun0 Link encap:IPIP Tunnel HWaddr
inet addr:192.168.0.1 P-t-P:148.251.225.166 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MTU:1350 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:5645 (5.5 KiB)
На сервере приемнике /etc/network/interfaces
auto eth0
iface eth0 inet static
address 151.80.92.205
netmask 255.255.255.255
broadcast 151.80.92.205
dns-nameservers 8.8.8.8 8.8.4.4
post-up route add 37.59.47.254 dev eth0
post-up route add default gw 37.59.47.254
pre-down route del 37.59.47.254 dev eth0
pre-down route del default gw 37.59.47.254
auto tun0
iface tun0 inet static
address 148.251.225.166
netmask 255.255.255.255
pointopoint 192.168.0.1
mtu 1350
pre-up /sbin/ip tunnel add tun0 mode ipip remote 151.80.92.205 local 151.80.92.205 dev eth0
post-up /sbin/ip ru add from 148.251.225.166 lookup 17 priority 17
post-up /sbin/ip ro add default via 192.168.0.1 dev tun0 src 148.251.225.166 table 17 mtu 1350 advmss 1310
pre-down /sbin/ip ro del default via 192.168.0.1 dev tun0 src 148.251.225.166 table 17 mtu 1350 advmss 1310
pre-down /sbin/ip ru del from 148.251.225.166 lookup 17 priority 17
post-down /sbin/ip tunnel del tun0
tun0 Link encap:IPIP Tunnel HWaddr
inet addr:148.251.225.166 P-t-P:192.168.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MTU:1350 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)