Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gre_Server_between_two_host_simple

 Gre_Server_between_two_host_simple

Simple Gre server, establish two tunnel between two host. We can connect one HostA and HOST B, and create a Gre tunnel.

ChenChih

July 18, 2016
Tweet

More Decks by ChenChih

Other Decks in Technology

Transcript

  1. Objective • Teach you how to setup simple Gre-server using

    two host. This is a simple Gre Server. Connect two host with either public or private ip. We don’t need to install anything.
  2. Basic information • PC(Server)-A – Ip address: 192.168.1.81 – greip:

    172.18.1.1 • PC(Server) -B – Ip address: 192.168.140.20 – Greip:172.19.1.1
  3. Enable gre interface • Enable interface – #sudo modprobe ip_gre

    • Show interface is it enable – #lsmod |grep gre
  4. PC-A setting • sudo ip tunnel add gre1 mode gre

    remote 192.168.140.20 local 192.168.1.81 ttl 255 • sudo ip link set gre1 up • sudo ip addr add 172.18.1.1/24 peer 172.19.1.1/24 dev gre1 • Note: Gre0: is been used, so we have to used gre1 172.18.1.1 =>PC-A gre ip address 172.19.1.2 => PC-B gre ip address
  5. PC-B setting • sudo ip tunnel add gre1 mode gre

    remote 192.168.1.81 local 192.168.140.20 ttl 255 • sudo ip link set gre1 up • sudo ip addr add 172.19.1.1/24 peer 172.18.1.1/24 dev gre1 • Note: 172.18.1.1 =>PC-A gre ip address 172.19.1.2 => PC-B gre ip address