12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8Consider the following scenario in the figure to establish a GRE tunnel between HostA and Host B:To configure Host A, you should first create a gre0 interface and then specify bothends of the link on the interface.# ifconfig gre0 create# ifconfig gre0 192.168.10.1 192.168.10.2 netmask 255.255.255.0# ifconfig gre0 tunnel 10.0.2.1 10.0.1.1On Host B, you should do the same; but remember not to swap the source ordestination addresses:# ifconfig gre0 create# ifconfig gre0 192.168.10.2 192.168.10.1 netmask 255.255.255.0# ifconfig gre0 tunnel 10.0.1.1 10.0.2.1The first line in the above procedure, a virtual tunnel interface (gre0) is created. Thesecond line configures the tunnel IP address on gre0 interface and also specifies thetunnel IP address of the other endpoint (connected tunnel interface). And finally thethird line establishes the tunnel between two hosts.This time, you need the real IPaddresses on your physical interfaces.Now you can verify the tunnel setup on Host A:# ifconfig gre0gre0: flags=9051 metric0 mtu 1476tunnel inet 10.0.2.1 --> 10.0.1.1inet 192.168.10.1 --> 192.168.10.2 netmask 0xffffff00The MTU size will be automatically calculated and configured on interface(in this case, 1476 byte) to compensate the GRE protocol overhead.[ 135 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!