|
1 | | -# Tunnel configuration |
| 1 | +# Tunnel Configuration |
2 | 2 |
|
3 | | -Tunnel traffic from point A to point B |
| 3 | +Infix supports multiple tunnel encapsulation protocols for connecting |
| 4 | +remote networks or devices across an IP backbone. Tunnels encapsulate |
| 5 | +packets within IP datagrams, allowing traffic to traverse intermediate |
| 6 | +networks transparently. |
4 | 7 |
|
| 8 | +> [!IMPORTANT] |
| 9 | +> When issuing `leave` to activate your changes, remember to also save |
| 10 | +> your settings, `copy running-config startup-config`. See the [CLI |
| 11 | +> Introduction](cli/introduction.md) for a background. |
5 | 12 |
|
6 | 13 | ## Generic Routing Encapsulation (GRE) |
7 | 14 |
|
8 | | -The support for GRE tunnels includes IPv4 and IPv6 tunnels both in GRE |
9 | | -(IP) and GRETAP (MAC) modes. |
| 15 | +GRE tunnels provide a simple and efficient method to encapsulate various |
| 16 | +network layer protocols over IP networks. Infix supports both IPv4 and |
| 17 | +IPv6 tunnels in two modes: |
| 18 | + |
| 19 | +- **GRE (Layer 3):** Point-to-point IP tunnel for routing protocols and |
| 20 | + routed traffic |
| 21 | +- **GRETAP (Layer 2):** Ethernet tunnel for bridging Layer 2 networks |
| 22 | + |
| 23 | +> [!TIP] |
| 24 | +> If you name your tunnel interface `greN` or `gretapN`, where `N` is a |
| 25 | +> number, the CLI infers the interface type automatically. |
| 26 | +
|
| 27 | +### Basic GRE Configuration |
| 28 | + |
| 29 | +A basic GRE tunnel for routing between two sites: |
| 30 | + |
| 31 | +``` |
| 32 | +admin@example:/> configure |
| 33 | +admin@example:/config/> edit interface gre0 |
| 34 | +admin@example:/config/interface/gre0/> set gre local 192.168.3.1 remote 192.168.3.2 |
| 35 | +admin@example:/config/interface/gre0/> set ipv4 address 10.255.0.1 prefix-length 30 |
| 36 | +admin@example:/config/interface/gre0/> leave |
| 37 | +admin@example:/> |
| 38 | +``` |
| 39 | + |
| 40 | +This creates a Layer 3 tunnel between 192.168.3.1 and 192.168.3.2 using |
| 41 | +the outer IP addresses, with the tunnel itself using 10.255.0.0/30 for |
| 42 | +the inner IP addressing. |
| 43 | + |
| 44 | +### GRETAP Configuration |
| 45 | + |
| 46 | +GRETAP tunnels operate at Layer 2, allowing bridging across the tunnel: |
| 47 | + |
10 | 48 | ``` |
11 | | -admin@example:/config/> edit interface gre1 |
12 | | -admin@example:/config/interface/gre1/> set type gretap |
13 | | -admin@example:/config/interface/gre1/> set gre local 192.168.3.1 remote 192.168.3.2 |
14 | | -admin@example:/config/interface/gre1/> leave |
| 49 | +admin@example:/> configure |
| 50 | +admin@example:/config/> edit interface gretap0 |
| 51 | +admin@example:/config/interface/gretap0/> set type gretap |
| 52 | +admin@example:/config/interface/gretap0/> set gre local 192.168.3.1 remote 192.168.3.2 |
| 53 | +admin@example:/config/interface/gretap0/> leave |
15 | 54 | admin@example:/> |
16 | 55 | ``` |
17 | 56 |
|
18 | | -## Virtual eXtensible Local Area Network (VXLAN) |
| 57 | +GRETAP interfaces can be added to a bridge, bridging local and remote Ethernet |
| 58 | +segments. See the [Bridge Configuration](networking.md#bridge-configuration) |
| 59 | +for more on bridges. |
| 60 | + |
| 61 | +### OSPF over GRE |
| 62 | + |
| 63 | +GRE tunnels are commonly used to carry dynamic routing protocols like |
| 64 | +OSPF across networks that don't support multicast or where you want to |
| 65 | +create a virtual topology different from the physical network. |
19 | 66 |
|
20 | | -The support for VXLAN tunnels includes IPv4 and IPv6. |
| 67 | +Example topology: Two sites connected via a GRE tunnel, running OSPF to |
| 68 | +exchange routes. |
21 | 69 |
|
| 70 | +**Site A configuration:** |
| 71 | + |
| 72 | +``` |
| 73 | +admin@siteA:/> configure |
| 74 | +admin@siteA:/config/> edit interface gre0 |
| 75 | +admin@siteA:/config/interface/gre0/> set gre local 203.0.113.1 remote 203.0.113.2 |
| 76 | +admin@siteA:/config/interface/gre0/> set ipv4 address 10.255.0.1 prefix-length 30 |
| 77 | +admin@siteA:/config/interface/gre0/> set ipv4 forwarding |
| 78 | +admin@siteA:/config/interface/gre0/> end |
| 79 | +admin@siteA:/config/> edit routing control-plane-protocol ospfv2 name default ospf |
| 80 | +admin@siteA:/config/routing/…/ospf/> set area 0.0.0.0 interface gre0 |
| 81 | +admin@siteA:/config/routing/…/ospf/> leave |
| 82 | +admin@siteA:/> |
22 | 83 | ``` |
| 84 | + |
| 85 | +**Site B configuration:** |
| 86 | + |
| 87 | +``` |
| 88 | +admin@siteB:/> configure |
| 89 | +admin@siteB:/config/> edit interface gre0 |
| 90 | +admin@siteB:/config/interface/gre0/> set gre local 203.0.113.2 remote 203.0.113.1 |
| 91 | +admin@siteB:/config/interface/gre0/> set ipv4 address 10.255.0.2 prefix-length 30 |
| 92 | +admin@siteB:/config/interface/gre0/> set ipv4 forwarding |
| 93 | +admin@siteB:/config/interface/gre0/> end |
| 94 | +admin@siteB:/config/> edit routing control-plane-protocol ospfv2 name default ospf |
| 95 | +admin@siteB:/config/routing/…/ospf/> set area 0.0.0.0 interface gre0 |
| 96 | +admin@siteB:/config/routing/…/ospf/> leave |
| 97 | +admin@siteB:/> |
| 98 | +``` |
| 99 | + |
| 100 | +Once configured, OSPF will establish a neighbor relationship through the |
| 101 | +tunnel and exchange routes between the sites. For more on OSPF |
| 102 | +configuration, see [Routing Configuration](routing.md). |
| 103 | + |
| 104 | +> [!NOTE] |
| 105 | +> Consider adjusting MTU on the tunnel interface to account for GRE |
| 106 | +> overhead (typically 24 bytes for IPv4, 44 bytes for IPv6) to avoid |
| 107 | +> fragmentation issues. |
| 108 | +
|
| 109 | +## Virtual eXtensible Local Area Network (VXLAN) |
| 110 | + |
| 111 | +VXLAN is a network virtualization technology that encapsulates Layer 2 |
| 112 | +Ethernet frames within Layer 4 UDP datagrams. It uses a 24-bit segment |
| 113 | +ID, termed VXLAN Network Identifier (VNI), allowing up to 16 million |
| 114 | +isolated networks. |
| 115 | + |
| 116 | +Infix supports both IPv4 and IPv6 for VXLAN tunnel endpoints. |
| 117 | + |
| 118 | +### Basic VXLAN Configuration |
| 119 | + |
| 120 | +``` |
| 121 | +admin@example:/> configure |
23 | 122 | admin@example:/config/> edit interface vxlan100 |
24 | 123 | admin@example:/config/interface/vxlan100/> set vxlan local 192.168.3.1 |
25 | 124 | admin@example:/config/interface/vxlan100/> set vxlan remote 192.168.3.2 |
26 | 125 | admin@example:/config/interface/vxlan100/> set vxlan vni 100 |
27 | 126 | admin@example:/config/interface/vxlan100/> leave |
| 127 | +admin@example:/> |
28 | 128 | ``` |
| 129 | + |
| 130 | +The VNI uniquely identifies the VXLAN segment and must match on both |
| 131 | +tunnel endpoints. |
| 132 | + |
| 133 | +### VXLAN with Custom UDP Port |
| 134 | + |
| 135 | +The default VXLAN UDP destination port is 4789 (IANA assigned). In some |
| 136 | +cases you may need to use a different port: |
| 137 | + |
| 138 | +``` |
| 139 | +admin@example:/> configure |
| 140 | +admin@example:/config/> edit interface vxlan100 |
| 141 | +admin@example:/config/interface/vxlan100/> set vxlan local 192.168.3.1 |
| 142 | +admin@example:/config/interface/vxlan100/> set vxlan remote 192.168.3.2 |
| 143 | +admin@example:/config/interface/vxlan100/> set vxlan vni 100 |
| 144 | +admin@example:/config/interface/vxlan100/> set vxlan remote-port 8472 |
| 145 | +admin@example:/config/interface/vxlan100/> leave |
| 146 | +admin@example:/> |
| 147 | +``` |
| 148 | + |
| 149 | +The remote-port setting allows interoperability with systems using |
| 150 | +non-standard VXLAN ports. |
| 151 | + |
| 152 | +> [!TIP] |
| 153 | +> If you name your VXLAN interface `vxlanN`, where `N` is a number, the |
| 154 | +> CLI infers the interface type automatically. |
0 commit comments