通過IP隧道實現虛擬伺服器(VS/TUN)
阿新 • • 發佈:2018-12-10
實驗環境: Server1(排程器):eth0:172.25.81.1/24 tunl0:172.25.81.100/24 Realserver: Server2(伺服器):eth0:172.25.81.2 tunl0:172.25.81.100/24 Server3(伺服器):eth0:172.25.81.3 tunl0:172.25.81.100/24 Client:172.25.81.250
server1設定
server2設定(2,3設定相同)
10 modprobe ipip 11 ip link set up tunl0 12 ip addr add 172.25.81.100/24 dev tunl0 13 /etc/init.d/arptables_jf start 14 sysctl -w net.ipv4.conf.tunl0.rp_filter=0 15 arptables -A IN -d 172.25.81.100 -j DROP 16 arptables -A OUT -s 172.25.81.100 -j mangle --mangle-ip-s 172.25.81.3 17 /etc/init.d/arptables_jf save
3client