Showing posts with label ip tunnel. Show all posts
Showing posts with label ip tunnel. Show all posts

2014-03-13

Tiny Core Linux IP Tunnel

A:
ip tunnel del tun0 mode ipip remote 192.168.3.112 local 172.16.0.81

ip tunnel add tun0 mode ipip remote 192.168.3.112 local 172.16.0.81
ip addr add 172.16.1.81/24 peer 172.16.1.112/24 dev tun0
ip link set tun0 up

#route add -net 192.168.1.0/24 gw 172.16.1.112


B:
ip tunnel add tun0 mode ipip remote 192.168.3.115 local 172.16.0.81
ip addr add 172.16.4.81/24 peer 172.16.4.115/24 dev tun0
ip link set tun0 up

route add -net 192.168.4.0/24 gw 172.16.4.115


===============


/sbin/ifconfig ip.tun2 plumb
/sbin/ifconfig ip.tun2 172.16.3.91 172.16.3.81 tsrc 192.168.21.91 tdst 192.168.15.81
/sbin/ifconfig ip.tun2 up

route add net 192.168.3.0/24 172.16.3.81

ip tunnel add tun2 mode ipip remote 192.168.21.91 local 192.168.15.81
ip addr add 172.16.3.81/24 peer 172.16.3.91/24 dev tun2
ip link set tun2 up



/sbin/ifconfig ip.tun0 plumb
/sbin/ifconfig ip.tun0 172.16.1.91 172.16.1.86 tsrc 192.168.2.91 tdst 192.168.6.86
/sbin/ifconfig ip.tun0 up

/sbin/ifconfig ip.tun0 down

/sbin/ifconfig ip.tun0 172.16.1.86 172.16.1.91 tsrc 192.168.6.86 tdst 192.168.2.91

Solaris
/sbin/ifconfig ip.tun1 plumb
/sbin/ifconfig ip.tun1 172.16.2.91 172.16.2.204 tsrc 192.168.2.91 tdst 192.168.1.204
/sbin/ifconfig ip.tun1 up


RedHat:
ip tunnel add tun0 mode ipip remote 192.168.2.91 local 192.168.1.204
ip addr add 172.16.2.204/24 peer 172.16.2.91/24 dev tun0
ip link set tun0 up

echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -s 172.16.2.0/24 -j MASQUERADE

route add -net 192.168.3.0/24 gw 172.16.0.1 eth1