I have a problem with IP tunneling.
Servers :
- services01 (proxmox host) (internal ips : 10.21.21.0/24) (tunnel ip 172.16.0.1)
- backup01 (proxmox host) (internal ips : 10.21.23.0/24) (tunnel ip 172.16.0.2)
VMs :
- 10.21.21.7 - VM1 on services01
- 10.21.23.4 - VM2 on backup01
Problem :
- Scenario 1. Using KVM login from to VM2 from backup01. Connect to fileshare on 10.21.21.7 and download any ~ 10 GB file, test network functionality, etc - everything is fine, no network problems, speed ~ 1 gbit, no timeouts.
- Scenario 2. Connect from 10.21.21.7 to 10.21.23.4 using Microsoft RDP, do nothing and each 2-3 minutes i am getting disconnected from RDP session and then reconnecting. According to ping data from 10.21.21.7 to 10.23.23.4 there is timeout (for 2-3 ping requests), but at the same time ping from 10.23.23.1 (host) to 10.23.23.4 show that there weren`t any timeouts.
Configuration :
/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 which i use to create VLAN-to-VLAN connection
#!/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