User Tools

Site Tools


networking:tunneling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking:tunneling [2017/04/24 07:47]
GreenReaper [Manual configuration example] Convert /etc/net config example section header into actual header
networking:tunneling [2019/09/21 12:14] (current)
soren Use full ip commands. If you're just trying to learn, it doesn't help that you have to make sense of the short forms.
Line 2: Line 2:
 =====Contents===== =====Contents=====
  
-  * [[#Introduction|1 Introduction]] +  * [[#introduction|1 Introduction]] 
-  * [[#IPIP_tunnels|2 IPIP tunnels]] +  * [[#ipip-tunnels|2 IPIP tunnels]] 
-    * [[#Manual_configuration_example|2.1 Manual configuration example]] +    * [[#manual-configuration-example|2.1 Manual configuration example]] 
-    * [[#.2Fetc.2Fnet_configuration_example|2.2 /etc/net configuration example]] +    * [[#etcnet-configuration-example|2.2 /etc/net configuration example]] 
-  * [[#GRE_tunnels|3 GRE tunnels]] +  * [[#gre-tunnels|3 GRE tunnels]] 
-    * [[#Manual_configuration_example_2|3.1 Manual configuration example]] +    * [[#manual-configuration-example1|3.1 Manual configuration example]] 
-    * [[#.2Fetc.2Fnet_configuration_example_2|3.2 /etc/net configuration example]] +    * [[#etcnet-configuration-example1|3.2 /etc/net configuration example]] 
-  * [[#SIT_tunnels|4 SIT tunnels]] +  * [[#sit-tunnels|4 SIT tunnels]] 
-    * [[#Manual_configuration_example_3|4.1 Manual configuration example]] +    * [[#manual-configuration-example2|4.1 Manual configuration example]] 
-    * [[#.2Fetc.2Fnet_configuration_example_3|4.2 /etc/net configuration example]] +    * [[#etcnet-configuration-example2|4.2 /etc/net configuration example]] 
-  * [[#Links|5 Links]]+  * [[#links|5 Links]]
  
 ===== Introduction===== ===== Introduction=====
Line 33: Line 33:
 ===== IPIP tunnels===== ===== IPIP tunnels=====
  
-IPIP kind of tunnels is the simplest one. It has the lowest overhead, but can incapsulate only IPv4 unicast traffic, so you will not be able to setup OSPF, RIP or any other multicast-based protocol. You can setup only one tunnel for unique tunnel endpoints pair. It can work with FreeBSD and cisco IOS. Kernel module is '​ipip'​. The following example demonstrates configuration of IPIP tunnel with four IPv4 routes.+IPIP kind of tunnels is the simplest one. It has the lowest overhead, but can incapsulate only IPv4 unicast traffic, so you will not be able to setup OSPF, RIP or any other multicast-based protocol. You can setup only one tunnel for unique tunnel endpoints pair. It can work with FreeBSD and cisco IOS. Kernel module is '​ipip'​. The following example demonstrates configuration of IPIP tunnel with four IPv4 routes, manually or via [[:​networking:​etcnet|/​etc/​net]]. 
 ==== Manual configuration example==== ==== Manual configuration example====
 <​code>​ # modprobe ipip <​code>​ # modprobe ipip
- # ip tu ad ipiptun mode ipip local 10.3.3.3 remote 10.4.4.4 ttl 64 dev eth0 + # ip tunnel add ipiptun mode ipip local 10.3.3.3 remote 10.4.4.4 ttl 64 dev eth0 
- # ip ad ad dev ipiptun 10.0.0.1 peer 10.0.0.2/​32 + # ip addr add dev ipiptun 10.0.0.1 peer 10.0.0.2/​32 
- # ip li se dev ipiptun up + # ip link set dev ipiptun up 
- # ip ro ad 10.4.10.0/​24 via 10.0.0.2 + # ip route add 10.4.10.0/​24 via 10.0.0.2 
- # ip ro ad 10.4.20.0/​24 via 10.0.0.2 + # ip route add 10.4.20.0/​24 via 10.0.0.2 
- # ip ro ad 10.4.30.0/​24 via 10.0.0.2 + # ip route add 10.4.30.0/​24 via 10.0.0.2 
- # ip ro ad 10.4.40.0/​24 via 10.0.0.2</​code>​+ # ip route add 10.4.40.0/​24 via 10.0.0.2</​code>​
  
 ==== /etc/net configuration example ==== ==== /etc/net configuration example ====
Line 69: Line 70:
 ==== Manual configuration example==== ==== Manual configuration example====
 <​code>​ # modprobe ip_gre <​code>​ # modprobe ip_gre
- # ip tu ad gretun mode gre local 10.5.5.5 remote 10.6.6.6 ttl 64 dev eth0 + # ip tunnel add gretun mode gre local 10.5.5.5 remote 10.6.6.6 ttl 64 dev eth0 
- # ip ad ad dev gretun 10.0.0.3 peer 10.0.0.4/​32 + # ip add add dev gretun 10.0.0.3 peer 10.0.0.4/​32 
- # ip li se dev gretun up + # ip link set dev gretun up 
- # ip ro ad 10.6.10.0/​24 via 10.0.0.4 + # ip route add 10.6.10.0/​24 via 10.0.0.4 
- # ip ro ad 10.6.20.0/​24 via 10.0.0.4</​code>​+ # ip route add 10.6.20.0/​24 via 10.0.0.4</​code>​
  
 ==== /etc/net configuration example ==== ==== /etc/net configuration example ====
Line 98: Line 99:
 ==== Manual configuration example==== ==== Manual configuration example====
 <​code>​ # modprobe ipv6 <​code>​ # modprobe ipv6
- # ip tu ad sittun mode sit local 10.7.7.7 remote 10.8.8.8 ttl 64 dev eth0 + # ip tunnel add sittun mode sit local 10.7.7.7 remote 10.8.8.8 ttl 64 dev eth0 
- # ip ad ad dev sittun 2001:​0DB8:​1234::​000e/​127 + # ip addr add dev sittun 2001:​0DB8:​1234::​000e/​127 
- # ip li se dev sittun up + # ip link set dev sittun up 
- # ip -6 ro ad 2001:​0DB8:​5678::/​48 via 2001:​0DB8:​1234::​000f + # ip -6 route add 2001:​0DB8:​5678::/​48 via 2001:​0DB8:​1234::​000f 
- # ip -6 ro ad 2001:​0DB8:​5679::/​48 via 2001:​0DB8:​1234::​000f + # ip -6 route add 2001:​0DB8:​5679::/​48 via 2001:​0DB8:​1234::​000f 
- # ip -6 ro ad 2001:​0DB8:​567a::/​48 via 2001:​0DB8:​1234::​000f</​code>​+ # ip -6 route add 2001:​0DB8:​567a::/​48 via 2001:​0DB8:​1234::​000f</​code>​
  
-==== /etc/net]] configuration example ====+==== /etc/net configuration example ====
 <​code>​ # mkdir /​etc/​net/​ifaces/​sittun <​code>​ # mkdir /​etc/​net/​ifaces/​sittun
  # cat > /​etc/​net/​ifaces/​sittun/​options  # cat > /​etc/​net/​ifaces/​sittun/​options
networking/tunneling.1493020075.txt.gz · Last modified: 2017/04/24 07:47 by GreenReaper