Connect Another Net Using IP Tunnel

Submitted by lepton on Fri, 10/18/2019 - 12:28

//computer one ip from ifconfig 192.168.1.2  public ip 2.2.2.2  
ip tunnel del ipip0
ip tunnel add ipip0 mode ipip remote 1.1.1.1 local 192.168.1.2
ip addr add 10.0.0.101/24 dev ipip0
ip link set ipip0 up

 

//computer two ip from ifconfig 192.168.100.2  public ip  1.1.1.1
ip tunnel del ipip0
ip tunnel add ipip0 mode ipip remote 2.2.2.2 local 192.168.100.2
ip addr add 10.0.0.102/24 dev ipip0
ip link set ipip0 up

 

//iptables

iptables -I INPUT -p 4 -j ACCEPT
iptables -I INPUT -p icmp -j ACCEPT
sysctl net.ipv4.ip_forward=1

 

//see network data

tcpdump -i eth0 |grep 2.2.2.2

 

//ping ip see available

ping 10.0.0.101

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.