summaryrefslogtreecommitdiff
path: root/docs/configuration/interfaces/vti.md
blob: dbd2c88cf7627970e572d1dcb8f64e1622dd0ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
(vti-interface)=

# VTI (virtual tunnel interface)

{abbr}`VTIs (virtual tunnel interfaces)` let you create secure, encrypted
tunnels between private networks or hosts across public infrastructure, such as
the Internet. They operate alongside an underlying IPsec tunnel, which handles
encapsulation and encryption, while VTIs function exclusively as routing
interfaces.

## Configuration

### Common interface configuration

```{cmdincludemd} /_include/interface-address.txt
:var0: vti
:var1: vti0
```

```{cmdincludemd} /_include/interface-description.txt
:var0: vti
:var1: vti0
```

```{cmdincludemd} /_include/interface-disable.txt
:var0: vti
:var1: vti0
```

```{cmdincludemd} /_include/interface-ip.txt
:var0: vti
:var1: vti0
```

```{cmdincludemd} /_include/interface-ipv6.txt
:var0: vti
:var1: vti0
```

```{cmdincludemd} /_include/interface-mtu.txt
:var0: vti
:var1: vti0
```

```{cfgcmd} set interfaces vti \<interface\> mirror egress \<monitor-interface\>

Configure mirroring of outgoing traffic from the specified VTI to the
designated monitor interface.
```

```{cfgcmd} set interfaces vti \<interface\> mirror ingress \<monitor-interface\>

Configure mirroring of incoming traffic from the specified VTI to the
designated monitor interface.
```

```{cfgcmd} set interfaces vti \<interface\> redirect \<interface\>

Enable redirection of incoming packets to the specified interface.
```

```{cmdincludemd} /_include/interface-vrf.txt
:var0: vti
:var1: vti0
```


## Operation

```{opcmd} show interfaces vti \<vtiX\>

Show the operational status and traffic statistics for the specified VTI.
```

```{opcmd} show interfaces vti \<vtiX\> brief

Show a brief operational status summary for the specified VTI.
```


## Example

**Configure a VTI**

Assign IPv4 and IPv6 addresses to the VTI, along with a brief description:

```none
set interfaces vti vti0 address 192.168.2.249/30
set interfaces vti vti0 address 2001:db8:2::249/64
set interfaces vti vti0 description "Description"
```

Resulting configuration:

```none
vyos@vyos# show interfaces vti
vti vti0 {
    address 192.168.2.249/30
    address 2001:db8:2::249/64
    description "Description"
}
```

:::{warning}
When configuring site-to-site IPsec with VTIs, ensure that route
autoinstall is disabled.
:::

```none
set vpn ipsec options disable-route-autoinstall
```

For more information about the IPsec and VTI issue, as well as the
`disable-route-autoinstall` option, see:
<https://blog.vyos.io/vyos-1-dot-2-0-development-news-in-july.>

The root cause of the problem is that VTI tunnels require their traffic
selectors to be set to `0.0.0.0/0` for traffic to match the tunnel, even
though routing decisions are based on netfilter marks. Unless route insertion
is explicitly disabled, strongSWAN incorrectly inserts a default route through
the VTI peer address, causing all traffic to be misrouted.