Eu tenho um problema com o tunelamento IP.
Servidores :
VMs:
Problema:
Configuração:
/etc/network/interfaces (backup01)
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet static
address xx.xx.xx.95
netmask 255.255.255.0
gateway xx.xx.xx.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
auto vmbr2
iface vmbr2 inet static
address 10.21.23.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables-restore -n < /root/rules.txt
Script que eu uso para criar conexão VLAN para VLAN
#!/bin/sh
#/etc/init.d/tun_serv
#
### BEGIN INIT INFO
# Provides: tun_serv
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Tun
# Description: Tunnel
### END INIT INFO
tun_name='tun_serv';
localip='xx.xx.xx.95';
remouteip='yy.yy.yy.213';
tunip='172.16.0.2';
ptpip='172.16.0.1';
route_to_net=10.21.21.0/24;
touch /var/lock/$tun_name;
case "$1" in
start)
echo "Create $tun_name Network"
ip tunnel add $tun_name mode ipip local $localip remote $remouteip dev vmbr0
ifconfig $tun_name $tunip/30 pointopoint $ptpip
ifconfig $tun_name up
echo "add routes to $route_to_net !"
ip route add $route_to_net via $ptpip dev $tun_name metric 0
echo "Add iptables rulles for multicast on ${tun_name}"
iptables -A INPUT -s $ptpip/30 -j ACCEPT
iptables -A INPUT -d $ptpip/30 -j ACCEPT
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -A INPUT -m pkttype --pkt-type broadcast -j ACCEPT
;;
stop)
echo "Stopping Network $tun_name"
ifconfig $tun_name down
echo "Remove routes"
ip route del $route_to_net via $ptpip dev $tun_name metric 0
;;
remove)
echo "Stopping Network $tun_name"
ifconfig $tun_name down
echo "Remove Network $tun_name"
ip tunnel del $tun_name
echo "Remove routes"
ip route del $route_to_net via $ptpip dev $tun_name metric 0
echo "Remove rules from iptables $tun_name"
iptables -D INPUT -s $ptpip/30 -j ACCEPT
iptables -D INPUT -d $ptpip/30 -j ACCEPT
iptables -D INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -D INPUT -m pkttype --pkt-type broadcast -j ACCEPT
;;
*)
echo "Usage: /etc/init.d/$tun_name {start|stop|remove}"
exit 1
;;
esac
exit 0
Tags networking windows rdp linux tunneling