И так, есть два сервера сервер-k и сервер-l Поднял на сервер-k
eth1:7 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:10.0.13.1 Bcast:10.0.13.31 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:17 Base address:0x4000
[root@сервер-k rc.d]# cat tnl3.sh
tnl=tnl3
remote=94.199.106.214
local=195.68.187.66
ip=10.0.13.1
range=10.0.13.2/32
ip tunnel add $tnl mode gre local $local remote $remote ttl 255
ip addr add $ip dev $tnl
ip link set $tnl up
ip route add $range dev $tnl
ip route add 10.10.20.0/24 dev $tnl
ip route add 192.168.15.0/24 dev $tnl
ip link set $tnl mtu 1500
[root@сервер-l rc.d]# cat tnl3.sh
tnl=tnl3
remote=xxx.xxx.xxx.xxx - интерфейс сервер-k
local=xxx.xxx.xxx.xxx - интерфейс сервер-l
ip=10.0.13.2
range=10.0.13.1/32
ip tunnel add $tnl mode gre local $local remote $remote ttl 255
ip addr add $ip dev $tnl
ip link set $tnl up
ip route add $range dev $tnl
ip route add 192.168.1.0/24 $tnl
ip route add 192.168.2.0/24 $tnl
ip route add 192.168.3.0/24 $tnl
ip route add 192.168.4.0/24 $tnl
ip route add 192.168.5.0/24 $tnl
ip link set $tnl mtu 1500
[root@сервер-k rc.d]# ping 10.0.13.2
PING 10.0.13.2 (10.0.13.2) 56(84) bytes of data.
64 bytes from 10.0.13.2: icmp_seq=1 ttl=64 time=5.35 ms
64 bytes from 10.0.13.2: icmp_seq=2 ttl=64 time=7.55 ms
64 bytes from 10.0.13.2: icmp_seq=3 ttl=64 time=5.56 ms
64 bytes from 10.0.13.2: icmp_seq=4 ttl=64 time=5.86 ms
[root@сервер-l rc.d]# ping 10.0.13.1
PING 10.0.13.1 (10.0.13.1) 56(84) bytes of data.
64 bytes from 10.0.13.1: icmp_req=1 ttl=64 time=7.32 ms
64 bytes from 10.0.13.1: icmp_req=2 ttl=64 time=6.76 ms
64 bytes from 10.0.13.1: icmp_req=3 ttl=64 time=6.41 ms
64 bytes from 10.0.13.1: icmp_req=4 ttl=64 time=8.09 ms
Казалось бы все хорошо, но нет.
[root@сервер-k rc.d]# ping 10.10.20.22
PING 10.10.20.22 (10.10.20.22) 56(84) bytes of data.
64 bytes from 10.10.20.22: icmp_seq=1 ttl=127 time=5.34 ms
64 bytes from 10.10.20.22: icmp_seq=2 ttl=127 time=6.20 ms
64 bytes from 10.10.20.22: icmp_seq=3 ttl=127 time=5.55 ms
64 bytes from 10.10.20.22: icmp_seq=4 ttl=127 time=5.49 ms
[root@сервер-l rc.d]# ping 192.168.2.47
PING 192.168.2.47 (192.168.2.47) 56(84) bytes of data.
From 192.168.3.2 icmp_seq=1 Time to live exceeded
From 192.168.3.2 icmp_seq=2 Time to live exceeded
From 192.168.3.2 icmp_seq=3 Time to live exceeded
From 192.168.3.2 icmp_seq=4 Time to live exceeded
Что тут не так, маршрут вроде должен бить норм, тунель должен работать, но вот что то не так со связью, роуты вроде норм...
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.11.1 0.0.0.0 255.255.255.255 UH 0 0 0 tnl1
10.0.13.1 0.0.0.0 255.255.255.255 UH 0 0 0 tnl3
xxx.xxx.xxx.xxx 0.0.0.0 255.255.255.252 U 0 0 0 eth0
10.10.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 xxx.xxx.xxx.xxx 0.0.0.0 UG 0 0 0 eth0
[root@сервер-l rc.d]#