Linux隧道配置
Server1:
Eth0:192.168.100.90 tunl1 172.16.100.90
Server2:
Eth0:192.168.100.100 tunl1 172.16.100.100
Server1 server2之间eth0同网段直连,但是tunl1之间无法互访
通过配置gre隧道使tunl1之间互相连接
Server1:
modeprobe ipip
modprobe ip_gre
iptunnel add tunl1 mode gre remote 192.168.100.100 local 192.168.100.90 dev eth0
ip link set tunl1 up
ip addr add 172.16.100.90 peer 172.16.100.100 dev tunl1
ip route add 172.16.100.0/24 dev tunl
Server2:
modeprobe ipip
modprobe ip_gre
iptunnel add tunl1 mode gre remote 192.168.100.90 local 192.168.100.100 dev eth0
ip link set tunl1 up
ip addr add 172.16.100.100 peer 172.16.100.90 dev tunl1
ip route add 172.16.100.0/24 dev tunl1
iptables -F
Ip 隧道
Server1:
modeprobe ipip
iptunnel add tunl1 mode ipip remote 192.168.100.100 local 192.168.100.90
ifconfig tunl1 172.16.100.90 netmask 255.255.255.255
route add -host 172.16.100.100 dev tunl1
Server2:
modeprobe ipip
iptunnel add tunl1 mode ipip remote 192.168.100.90 local 192.168.100.100
ifconfig tunl1 172.16.100.100 netmask 255.255.255.255
ip route add 172.16.100.90 dev tunl1
Server1:
Eth0:192.168.100.90 tunl1 172.16.100.90
Server2:
Eth0:192.168.100.100 tunl1 172.16.100.100
Server1 server2之间eth0同网段直连,但是tunl1之间无法互访
通过配置gre隧道使tunl1之间互相连接
Server1:
modeprobe ipip
modprobe ip_gre
iptunnel add tunl1 mode gre remote 192.168.100.100 local 192.168.100.90 dev eth0
ip link set tunl1 up
ip addr add 172.16.100.90 peer 172.16.100.100 dev tunl1
ip route add 172.16.100.0/24 dev tunl
Server2:
modeprobe ipip
modprobe ip_gre
iptunnel add tunl1 mode gre remote 192.168.100.90 local 192.168.100.100 dev eth0
ip link set tunl1 up
ip addr add 172.16.100.100 peer 172.16.100.90 dev tunl1
ip route add 172.16.100.0/24 dev tunl1
iptables -F
Ip 隧道
Server1:
modeprobe ipip
iptunnel add tunl1 mode ipip remote 192.168.100.100 local 192.168.100.90
ifconfig tunl1 172.16.100.90 netmask 255.255.255.255
route add -host 172.16.100.100 dev tunl1
Server2:
modeprobe ipip
iptunnel add tunl1 mode ipip remote 192.168.100.90 local 192.168.100.100
ifconfig tunl1 172.16.100.100 netmask 255.255.255.255
ip route add 172.16.100.90 dev tunl1