set interfaces tunnel tun0
set interfaces tunnel tun0 address 192.168.127.1/24
set interfaces tunnel tun0 description "Gre Tunnel to SamiHome"
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-ip 93.155.130.11
set interfaces tunnel tun0 remote-ip 10.18.6.162 |
set interfaces tunnel tun0
set interfaces tunnel tun0 address 192.168.127.1/24
set interfaces tunnel tun0 description "Gre Tunnel to SamiHome"
set interfaces tunnel tun0 encapsulation gre
set interfaces tunnel tun0 local-ip 93.155.130.11
set interfaces tunnel tun0 remote-ip 10.18.6.162
ЗАБЕЛЕЖКА:
Тъи като vyatta все още не поддържа TCPMSS могат да възникнат някой проблеми ако има NAT. Поради тази причина може да се наложи да добавим този ред.
vyatta@core2# sudo su
core2:/home/vyatta# iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o tun0 -j TCPMSS --clamp-mss-to-pmtu |
vyatta@core2# sudo su
core2:/home/vyatta# iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o tun0 -j TCPMSS --clamp-mss-to-pmtu
този ред може да се добави и в /etc/rc.local
Конфигурация на втората машина която е Debian.
auto tun1
iface tun1 inet static
address 192.168.127.2
netmask 255.255.255.0
up ifconfig tun1 multicast
pre-up iptunnel add tun1 mode gre remote 93.155.130.11 local 10.18.6.162 ttl 255
pointopoint 192.168.127.1
post-down iptunnel del tun1 |
auto tun1
iface tun1 inet static
address 192.168.127.2
netmask 255.255.255.0
up ifconfig tun1 multicast
pre-up iptunnel add tun1 mode gre remote 93.155.130.11 local 10.18.6.162 ttl 255
pointopoint 192.168.127.1
post-down iptunnel del tun1
vyatta@vyatta# show interfaces tunnel
tun0 {
address 192.168.127.1/24
description "Gre Tunnel to SamiHome"
encapsulation gre
local-ip 93.155.130.11
remote-ip 10.18.6.162
}
[edit]
vyatta@vyatta# ping 192.168.127.2
PING 192.168.127.2 (192.168.127.2) 56(84) bytes of data.
64 bytes from 192.168.127.2: icmp_seq=1 ttl=64 time=2.67 ms
64 bytes from 192.168.127.2: icmp_seq=2 ttl=64 time=0.247 ms
64 bytes from 192.168.127.2: icmp_seq=3 ttl=64 time=3.96 ms
64 bytes from 192.168.127.2: icmp_seq=4 ttl=64 time=0.517 ms
^C
--- 192.168.127.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3055ms
rtt min/avg/max/mdev = 0.247/1.852/3.966/1.542 ms
[edit] |
vyatta@vyatta# show interfaces tunnel
tun0 {
address 192.168.127.1/24
description "Gre Tunnel to SamiHome"
encapsulation gre
local-ip 93.155.130.11
remote-ip 10.18.6.162
}
[edit]
vyatta@vyatta# ping 192.168.127.2
PING 192.168.127.2 (192.168.127.2) 56(84) bytes of data.
64 bytes from 192.168.127.2: icmp_seq=1 ttl=64 time=2.67 ms
64 bytes from 192.168.127.2: icmp_seq=2 ttl=64 time=0.247 ms
64 bytes from 192.168.127.2: icmp_seq=3 ttl=64 time=3.96 ms
64 bytes from 192.168.127.2: icmp_seq=4 ttl=64 time=0.517 ms
^C
--- 192.168.127.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3055ms
rtt min/avg/max/mdev = 0.247/1.852/3.966/1.542 ms
[edit]