Skip to content

Commit 0a31770

Browse files
authored
Merge pull request #1246 from kernelkit/gre-plus-plus
Add TTL, ToS/DSCP, and PMTU Discovery configuration to tunnels
2 parents bf2e739 + 461d8b7 commit 0a31770

27 files changed

+914
-120
lines changed

doc/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ All notable changes to the project are documented in this file.
2020
the [`latest-boot` release][lastest-boot] tag
2121
- The `utils/mkimage.sh` script now supports fetching the bootloader
2222
- The raspberrypi-rpi64 board's bootloader is now aptly named rpi64
23+
- Add support for configuring TTL, ToS/DSCP, and Path MTU Discovery on GRE and
24+
VXLAN tunnels. This also changes the default TTL of tunnels to 64, from the
25+
kernel default (*inherit*), which in turn fixes reported issues with dropped
26+
OSPF Hello frames in GRE tunnels
2327

2428
### Fixes
2529

doc/dhcp.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ with an address pool:
2121

2222
```
2323
admin@example:/> configure
24-
admin@example:/config/> edit dhcp-server
25-
admin@example:/config/dhcp-server/> edit subnet 192.168.2.0/24
26-
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> set pool start-address 192.168.2.100 end-address 192.168.2.200
27-
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> leave
24+
admin@example:/config/> edit dhcp-server subnet 192.168.2.0/24
25+
admin@example:/config/dhcp-server/…/192.168.2.0/24/> set pool start-address 192.168.2.100 end-address 192.168.2.200
26+
admin@example:/config/dhcp-server/…/192.168.2.0/24/> leave
2827
```
2928

3029
When setting up the server from the CLI, the system automatically adds a
@@ -70,21 +69,21 @@ To reserve specific IP addresses for clients based on their MAC address,
7069
hostname, or client ID:
7170

7271
```
73-
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> edit host 192.168.2.10
74-
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/host/192.168.2.10/> set match mac-address 00:11:22:33:44:55
75-
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/host/192.168.2.10/> set hostname printer
76-
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/host/192.168.2.10/> leave
72+
admin@example:/config/dhcp-server//192.168.2.0/24/> edit host 192.168.2.10
73+
admin@example:/config/dhcp-server//192.168.2.10/> set match mac-address 00:11:22:33:44:55
74+
admin@example:/config/dhcp-server//192.168.2.10/> set hostname printer
75+
admin@example:/config/dhcp-server//192.168.2.10/> leave
7776
```
7877

7978
Match hosts using a client identifier instead of MAC address:
8079

8180
```
82-
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/> edit host 192.168.1.50
83-
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/> edit match
84-
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/match/> set client-id hex c0:ff:ee
85-
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/match/> leave
86-
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/> set lease-time infinite
87-
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/> leave
81+
admin@example:/config/dhcp-server//192.168.1.0/24/> edit host 192.168.1.50
82+
admin@example:/config/dhcp-server//192.168.1.50/> edit match
83+
admin@example:/config/dhcp-server//match/> set client-id hex c0:ff:ee
84+
admin@example:/config/dhcp-server//match/> leave
85+
admin@example:/config/dhcp-server//192.168.1.50/> set lease-time infinite
86+
admin@example:/config/dhcp-server//192.168.1.50/> leave
8887
```
8988

9089
The `hex` prefix here ensures matching of client ID is done using the

doc/firewall.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -289,25 +289,25 @@ blocks external threats.
289289
admin@example:/config/> <b>edit firewall</b>
290290
admin@example:/config/firewall/> <b>set default wan</b>
291291
admin@example:/config/firewall/> <b>edit zone lan</b>
292-
admin@example:/config/firewall/zone/lan/> <b>set description "Internal LAN network - trusted"</b>
293-
admin@example:/config/firewall/zone/lan/> <b>set action accept</b>
294-
admin@example:/config/firewall/zone/lan/> <b>set interface eth1</b>
295-
admin@example:/config/firewall/zone/lan/> <b>set service ssh</b>
296-
admin@example:/config/firewall/zone/lan/> <b>set service dhcp</b>
297-
admin@example:/config/firewall/zone/lan/> <b>set service dns</b>
298-
admin@example:/config/firewall/zone/lan/> <b>end</b>
292+
admin@example:/config/firewall//lan/> <b>set description "Internal LAN network - trusted"</b>
293+
admin@example:/config/firewall//lan/> <b>set action accept</b>
294+
admin@example:/config/firewall//lan/> <b>set interface eth1</b>
295+
admin@example:/config/firewall//lan/> <b>set service ssh</b>
296+
admin@example:/config/firewall//lan/> <b>set service dhcp</b>
297+
admin@example:/config/firewall//lan/> <b>set service dns</b>
298+
admin@example:/config/firewall//lan/> <b>end</b>
299299
admin@example:/config/firewall/> <b>edit zone wan</b>
300-
admin@example:/config/firewall/zone/wan/> <b>set description "External WAN interface - untrusted"</b>
301-
admin@example:/config/firewall/zone/wan/> <b>set action drop</b>
302-
admin@example:/config/firewall/zone/wan/> <b>set interface eth0</b>
303-
admin@example:/config/firewall/zone/wan/> <b>end</b>
300+
admin@example:/config/firewall//wan/> <b>set description "External WAN interface - untrusted"</b>
301+
admin@example:/config/firewall//wan/> <b>set action drop</b>
302+
admin@example:/config/firewall//wan/> <b>set interface eth0</b>
303+
admin@example:/config/firewall//wan/> <b>end</b>
304304
admin@example:/config/firewall/> <b>edit policy loc-to-wan</b>
305-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set description "Allow LAN traffic to WAN with SNAT"</b>
306-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set ingress lan</b>
307-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set egress wan</b>
308-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set action accept</b>
309-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set masquerade</b>
310-
admin@example:/config/firewall/policy/loc-to-wan/> <b>leave</b>
305+
admin@example:/config/firewall//loc-to-wan/> <b>set description "Allow LAN traffic to WAN with SNAT"</b>
306+
admin@example:/config/firewall//loc-to-wan/> <b>set ingress lan</b>
307+
admin@example:/config/firewall//loc-to-wan/> <b>set egress wan</b>
308+
admin@example:/config/firewall//loc-to-wan/> <b>set action accept</b>
309+
admin@example:/config/firewall//loc-to-wan/> <b>set masquerade</b>
310+
admin@example:/config/firewall//loc-to-wan/> <b>leave</b>
311311
</pre></code>
312312

313313
### Enterprise Gateway
@@ -317,28 +317,28 @@ resources. We can build upon the Home/Office Router example above and add
317317
a DMZ zone with additional policies for controlled access.
318318
<code><pre>admin@example:/> <b>configure</b>
319319
admin@example:/config/> <b>edit firewall zone dmz</b>
320-
admin@example:/config/firewall/zone/dmz/> <b>set description "Semi-trusted public services"</b>
321-
admin@example:/config/firewall/zone/dmz/> <b>set action drop</b>
322-
admin@example:/config/firewall/zone/dmz/> <b>set interface eth1</b>
323-
admin@example:/config/firewall/zone/dmz/> <b>set service ssh</b>
324-
admin@example:/config/firewall/zone/dmz/> <b>end</b>
320+
admin@example:/config/firewall//dmz/> <b>set description "Semi-trusted public services"</b>
321+
admin@example:/config/firewall//dmz/> <b>set action drop</b>
322+
admin@example:/config/firewall//dmz/> <b>set interface eth1</b>
323+
admin@example:/config/firewall//dmz/> <b>set service ssh</b>
324+
admin@example:/config/firewall//dmz/> <b>end</b>
325325
admin@example:/config/firewall/> <b>edit policy loc-to-wan</b>
326-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set description "Allow local networks (LAN+DMZ) to WAN with SNAT"</b>
327-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set ingress dmz</b>
328-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set egress wan</b>
329-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set action accept</b>
330-
admin@example:/config/firewall/policy/loc-to-wan/> <b>set masquerade</b>
331-
admin@example:/config/firewall/policy/loc-to-wan/> <b>end</b>
326+
admin@example:/config/firewall//loc-to-wan/> <b>set description "Allow local networks (LAN+DMZ) to WAN with SNAT"</b>
327+
admin@example:/config/firewall//loc-to-wan/> <b>set ingress dmz</b>
328+
admin@example:/config/firewall//loc-to-wan/> <b>set egress wan</b>
329+
admin@example:/config/firewall//loc-to-wan/> <b>set action accept</b>
330+
admin@example:/config/firewall//loc-to-wan/> <b>set masquerade</b>
331+
admin@example:/config/firewall//loc-to-wan/> <b>end</b>
332332
admin@example:/config/firewall/> <b>edit policy lan-to-dmz</b>
333-
admin@example:/config/firewall/policy/lan-to-dmz/> <b>set description "Allow LAN to manage DMZ services"</b>
334-
admin@example:/config/firewall/policy/lan-to-dmz/> <b>set ingress lan</b>
335-
admin@example:/config/firewall/policy/lan-to-dmz/> <b>set egress dmz</b>
336-
admin@example:/config/firewall/policy/lan-to-dmz/> <b>set action accept</b>
337-
admin@example:/config/firewall/policy/lan-to-dmz/> <b>end</b>
333+
admin@example:/config/firewall//lan-to-dmz/> <b>set description "Allow LAN to manage DMZ services"</b>
334+
admin@example:/config/firewall//lan-to-dmz/> <b>set ingress lan</b>
335+
admin@example:/config/firewall//lan-to-dmz/> <b>set egress dmz</b>
336+
admin@example:/config/firewall//lan-to-dmz/> <b>set action accept</b>
337+
admin@example:/config/firewall//lan-to-dmz/> <b>end</b>
338338
admin@example:/config/firewall/> <b>edit zone wan port-forward 8080 tcp</b>
339-
admin@example:/config/firewall/zone/wan/port-forward/8080/tcp/> <b>set to addr 192.168.2.10</b>
340-
admin@example:/config/firewall/zone/wan/port-forward/8080/tcp/> <b>set to port 80</b>
341-
admin@example:/config/firewall/zone/wan/port-forward/8080/tcp/> <b>leave</b>
339+
admin@example:/config/firewall//tcp/> <b>set to addr 192.168.2.10</b>
340+
admin@example:/config/firewall//tcp/> <b>set to port 80</b>
341+
admin@example:/config/firewall//tcp/> <b>leave</b>
342342
</pre></code>
343343

344344
This adds a DMZ zone for public services, updates the internet access policy

doc/networking.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,18 +1264,18 @@ control plane protocol. For our examples we use the instance name
12641264
For a route with destination 192.168.200.0/24 via 192.168.1.1:
12651265

12661266
admin@example:/> configure
1267-
admin@example:/config/> edit routing control-plane-protocol static name default
1268-
admin@example:/config/routing/control-plane-protocol/static/name/default/> set ipv4 route 192.168.200.0/24 next-hop next-hop-address 192.168.1.1
1269-
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
1267+
admin@example:/config/> edit routing control-plane-protocol static name default ipv4
1268+
admin@example:/config/routing/…/ipv4/> set route 192.168.200.0/24 next-hop next-hop-address 192.168.1.1
1269+
admin@example:/config/routing/…/ipv4/> leave
12701270
admin@example:/>
12711271

12721272
For a "floating" static route with destination 10.0.0.0/16 via a backup
12731273
router 192.168.1.1, using the highest possible distance:
12741274

12751275
admin@example:/> configure
1276-
admin@example:/config/> edit routing control-plane-protocol static name default
1277-
admin@example:/config/routing/control-plane-protocol/static/name/default/> set ipv4 route 10.0.0.0/16 next-hop next-hop-address 192.168.1.1 route-preference 254
1278-
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
1276+
admin@example:/config/> edit routing control-plane-protocol static name default ipv4
1277+
admin@example:/config/routing/…/ipv4/> set route 10.0.0.0/16 next-hop next-hop-address 192.168.1.1 route-preference 254
1278+
admin@example:/config/routing/…/ipv4/> leave
12791279
admin@example:/>
12801280

12811281
> [!TIP]
@@ -1286,9 +1286,9 @@ router 192.168.1.1, using the highest possible distance:
12861286
### IPv6 Static routes
12871287

12881288
admin@example:/> configure
1289-
admin@example:/config/> edit routing control-plane-protocol static name default
1290-
admin@example:/config/routing/control-plane-protocol/static/name/default/> set ipv6 route 2001:db8:3c4d:200::/64 next-hop next-hop-address 2001:db8:3c4d:1::1
1291-
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
1289+
admin@example:/config/> edit routing control-plane-protocol static name default ipv6
1290+
admin@example:/config/routing/…/ipv6/> set route 2001:db8:3c4d:200::/64 next-hop next-hop-address 2001:db8:3c4d:1::1
1291+
admin@example:/config/routing/…/ipv6/> leave
12921292
admin@example:/>
12931293

12941294

@@ -1297,9 +1297,9 @@ router 192.168.1.1, using the highest possible distance:
12971297
The system supports OSPF dynamic routing for IPv4, i.e., OSPFv2. To
12981298
enable OSPF and set one active interface in area 0:
12991299

1300-
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default
1301-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> set ospf area 0.0.0.0 interface e0 enabled
1302-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
1300+
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default ospf
1301+
admin@example:/config/routing/…/ospf/> set area 0.0.0.0 interface e0 enabled
1302+
admin@example:/config/routing/…/ospf/> leave
13031303
admin@example:/>
13041304

13051305
> [!TIP]
@@ -1312,10 +1312,10 @@ enable OSPF and set one active interface in area 0:
13121312
In addition to *regular* OSPF areas, area types *NSSA* and *Stub* are
13131313
also supported. To configure an NSSA area with summary routes:
13141314

1315-
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default
1316-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> set ospf area 0.0.0.1 area-type nssa-area
1317-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> set ospf area 0.0.0.1 summary true
1318-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
1315+
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default ospf
1316+
admin@example:/config/routing/…/ospf/> set area 0.0.0.1 area-type nssa-area
1317+
admin@example:/config/routing/…/ospf/> set area 0.0.0.1 summary true
1318+
admin@example:/config/routing/…/ospf/> leave
13191319
admin@example:/>
13201320

13211321

@@ -1324,9 +1324,9 @@ also supported. To configure an NSSA area with summary routes:
13241324
It is possible to enable BFD per OSPF interface to speed up detection of
13251325
link loss.
13261326

1327-
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default
1328-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set area 0.0.0.0 interface e0 bfd enabled true
1329-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
1327+
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default ospf
1328+
admin@example:/config/routing//ospf/> set area 0.0.0.0 interface e0 bfd enabled true
1329+
admin@example:/config/routing/…/ospf/> leave
13301330
admin@example:/>
13311331

13321332

@@ -1337,9 +1337,9 @@ and BFD for OSPF per interface (*bfd enabled true*). These and other
13371337
OSPF interface settings are done in context of an OSFP area, e.g., *area
13381338
0.0.0.0*. Available commands can be listed using the `?` mark.
13391339

1340-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> edit ospf area 0.0.0.0
1341-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/> edit interface e0
1342-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/> set ?
1340+
admin@example:/config/routing//> edit ospf area 0.0.0.0
1341+
admin@example:/config/routing//ospf/area/0.0.0.0/> edit interface e0
1342+
admin@example:/config/routing//ospf/area/0.0.0.0/interface/e0/> set ?
13431343
bfd BFD interface configuration.
13441344
cost Interface's cost.
13451345
dead-interval Interval after which a neighbor is declared down
@@ -1349,13 +1349,13 @@ OSPF interface settings are done in context of an OSFP area, e.g., *area
13491349
passive Enables/disables a passive interface. A passive
13501350
retransmit-interval Interval between retransmitting unacknowledged Link
13511351
transmit-delay Estimated time needed to transmit Link State Update
1352-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/> set
1352+
admin@example:/config/routing//ospf/area/0.0.0.0/interface/e0/> set
13531353

13541354
For example, setting the OSPF *interface type* to *point-to-point* for
13551355
an Ethernet interface can be done as follows.
13561356

1357-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/> set interface-type point-to-point
1358-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/>
1357+
admin@example:/config/routing//ospf/area/0.0.0.0/interface/e0/> set interface-type point-to-point
1358+
admin@example:/config/routing//ospf/area/0.0.0.0/interface/e0/>
13591359

13601360
#### OSPF global settings
13611361

@@ -1364,12 +1364,12 @@ global settings for route redistribution and OSPF router identifier.
13641364

13651365
```
13661366
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default ospf
1367-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set ?
1367+
admin@example:/config/routing//ospf/> set ?
13681368
area List of OSPF areas.
13691369
default-route-advertise Distribute default route to network
13701370
explicit-router-id Defined in RFC 2328. A 32-bit number
13711371
redistribute Redistribute protocols into OSPF
1372-
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set
1372+
admin@example:/config/routing//ospf/> set
13731373
```
13741374

13751375
- Explicit router ID: By default the router will pick an IP address

doc/syslog.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ For a list of available log facilities, see the table in a later section.
2323

2424
```
2525
admin@example:/> configure
26-
admin@example:/config/> edit syslog
27-
admin@example:/config/syslog/> edit actions log-file file:/media/log/mylog
28-
admin@example:/config/syslog/actions/log-file/file:/media/log/mylog/> set facility-list
26+
admin@example:/config/> edit syslog actions log-file file:/media/log/mylog
27+
admin@example:/config/syslog/…/file:/media/log/mylog/> set facility-list
2928
all audit auth authpriv console cron cron2 daemon ftp kern
3029
local0 local1 local2 local3 local4 local5 local6 local7 lpr mail
3130
news ntp syslog user uucp
32-
admin@example:/config/syslog/actions/log-file/file:/media/log/mylog/> set facility-list all severity
31+
admin@example:/config/syslog//file:/media/log/mylog/> set facility-list all severity
3332
alert all critical debug emergency error info none notice warning
34-
admin@example:/config/syslog/actions/log-file/file:/media/log/mylog/> set facility-list all severity critical
35-
admin@example:/config/syslog/actions/log-file/file:/media/log/mylog/> set facility-list mail severity warning
36-
admin@example:/config/syslog/actions/log-file/file:/media/log/mylog/> leave
33+
admin@example:/config/syslog//file:/media/log/mylog/> set facility-list all severity critical
34+
admin@example:/config/syslog//file:/media/log/mylog/> set facility-list mail severity warning
35+
admin@example:/config/syslog//file:/media/log/mylog/> leave
3736
admin@example:/>
3837
```
3938

@@ -137,11 +136,11 @@ perform time stamping at the time of arrival.
137136
Configuring the log format is the same for log files and remotes:
138137

139138
```
140-
admin@example:/config/> edit syslog actions log-file file:foobar
141-
admin@example:/config/syslog/actions/log-file/file:foobar/> set log-format
139+
admin@example:/config/> edit syslog actions log-file file:foobar
140+
admin@example:/config/syslog/…/file:foobar/> set log-format
142141
bsd rfc3164 rfc5424
143-
admin@example:/config/syslog/actions/log-file/file:foobar/> set log-format rfc5424
144-
admin@example:/config/syslog/actions/log-file/file:foobar/> leave
142+
admin@example:/config/syslog/…/file:foobar/> set log-format rfc5424
143+
admin@example:/config/syslog//file:foobar/> leave
145144
admin@example:/>
146145
```
147146

@@ -163,13 +162,13 @@ up, as well as local policy.
163162
admin@example:/config/> edit syslog
164163
actions file-rotation server
165164
admin@example:/config/> edit syslog actions destination moon
166-
admin@example:/config/syslog/actions/destination/moon/> set
165+
admin@example:/config/syslog//moon/> set
167166
facility-list log-format udp
168-
admin@example:/config/syslog/actions/destination/moon/> set udp
167+
admin@example:/config/syslog//moon/> set udp
169168
address port
170-
admin@example:/config/syslog/actions/destination/moon/> set udp address 192.168.0.12
171-
admin@example:/config/syslog/actions/destination/moon/> set facility-list container severity all
172-
admin@example:/config/syslog/actions/destination/moon/> leave
169+
admin@example:/config/syslog//moon/> set udp address 192.168.0.12
170+
admin@example:/config/syslog//moon/> set facility-list container severity all
171+
admin@example:/config/syslog//moon/> leave
173172
admin@example:/>
174173
```
175174

0 commit comments

Comments
 (0)