FortiOS - Net Device - Version 2020 10 28
FortiOS - Net Device - Version 2020 10 28
Date Author
2020-10-28 S. Hamelin Added slide for the ip4 route tree
Updated the “Upgrade” slide and added a “Restriction” slide
As of FortiOS 6.4/6.2.2, tunnel overlay IPs can be provisioned with IKE mode-config
As of FortiOS 6.4.3/6.2.6, the tunnel name maximum length is extended
2019-08-23 S. Hamelin As of FortiOS 6.2.0, “net-device” also applies to static phase1
Document renamed from “New IPsec dialup logic” to “New route-based IPsec logic”
2019-04-08 S. Hamelin NATed Spokes are supported with OSPF only as of FortiOS 6.2/6.0.5
IKE route overlap between dialup tunnels is not supported
2018-06-29 S. Hamelin Initial version for Fortinet NSE Xperts Academy event
2
New route-based IPsec logic (‘set net-device disable’)
Overview
IPsec dialup
▪ “net-device” for route-based IPsec dialup tunnels
» As of FortiOS 6.0 & 5.6.3 a new behavior is implemented for routing traffic to
IPsec dialup tunnels
» This behavior is controlled by new CLI settings
Hub configuration
4
IPsec static
▪ “net-device” for route-based IPsec static tunnels
5
Historical IPsec dialup behavior
▪ A dialup tunnel is created for each successful dial-in negotiation
Hub IKE debug
------------------------------------------------------
name=Spoke_3 ver=1 serial=6 198.51.100.1:0->198.51.100.4:0
bound_if=4 lgwy=static/1 tun=intf/0 mode=dial_inst/3 encap=none/0
parent=Spoke index=3
(...)
6
Historical IPsec dialup behavior (cont.)
8
Historical IPsec dialup behavior (cont.)
Hub #
» net-device disable means “do not create interfaces (i.e., network devices)”
▪ Networks accessible over dialup tunnels are all bound to the same
shared (phase1) interface
Hub # get router info routing-table bgp
B 192.168.2.0/24 [200/0] via 10.10.10.2, Spoke, 01:04:49
B 192.168.3.0/24 [200/0] via 10.10.10.3, Spoke, 01:04:47
B 192.168.4.0/24 [200/0] via 10.10.10.4, Spoke, 00:35:01
B 192.168.5.0/24 [200/0] via 10.10.10.5, Spoke, 01:04:51
12
New IPsec dialup behavior (cont.)
14
New IPsec dialup behavior (cont.)
15
New IPsec dialup behavior (cont.)
16
New IPsec dialup behavior (cont.)
Underlay
198.51.100.2 2 indexes “set auto-discovery-sender enable” [Hub]
198.51.100.3 0
IPsec 198.51.100.4 3
tunnel or with
198.51.100.5 1
endpoints
“set mode-cfg enable”
18
Slow-Path (session setup)
HISTORICAL dst-ip = 192.168.4.1 NEW
Dedicated interface Shared interface
per dialer per phase1
20
IPsec VPN
Up to 5.4
& 5.6.0/5.6.1/5.6.2
As of 5.6.3 & 6.0
22
Upgrade
When upgrading from a FortiOS version which does not have “net-device” setting,
“set net-device enable” is added to all dialup phase1.
This is done to retain the former dialup behavior of creating a dynamic interface for
each dialer.
23
Restrictions for “net-device disable” with IKE routes
The subnets protected by the
Spokes are learned from the traffic
▪ Up to FortiOS 6.2.0 The Hub can learn a given subnet only once selectors of the IPsec SA negotiation
Not
Supported HUB
phase1
Not
Supported HUB
phase1
Not
Supported
phase1
HUB
phase1
“I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting
192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24”
▪ As of FortiOS 6.2.1 The Hub can learn a given subnet once per phase1
✓
Not
Supported HUB
Not
Supported HUB
phase1
Supported
phase1
HUB
phase1
phase1
“I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting
192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24”
E.g., with a phase1 name of “spn3-inetBB’ (11-char) only 3-char remains for the index itself thereby limiting
to [0-999] the index range (spn3-inetBB_XXX): the maximum number of concurrent dialup tunnels is limited
to 1000
25
New IPsec dialup logic
With BGP
Overlay IPs
Overlay IPs of the Spokes (10.10.10.x) can be provisioned in two ways:
.1
192.168.1.0/24
.254
▪ Manually on each Spoke Paris
config system interface config system interface
HUB edit "toSpokes" Spoke edit "toHub" 10.10.10.1
.1
set ip 10.10.10.1/32 set ip 10.10.10.2/32 toSpokes_0 toSpokes_1
set remote-ip 10.10.10.254/24 set remote-ip 10.10.10.1/24
next next
.254
end end
ISP1
▪ Automatically from the Hub using IKE mode-config as of FOS 6.2.2 198.51.100.0/24
28
Hub IPsec configuration
config vpn ipsec phase1-interface
edit "toSpokes"
/24 set type dynamic
.1
The overlay IPs of all Hub & Spoke participants are in the same set net-device disable
192.168.1.0/24
set tunnel-search nexthop
subnet Hub set interface "wan"
set proposal aes128-sha1
The mask for the local ip can only be /32 10.10.10.1/24
set add-route disable
.1 set exchange-interface-ip enable
So, the mask for the overlay subnet set auto-discovery-sender enable
must be specified in ‘remote-ip’ toSpokes
set psksecret xxxxxxxx
next
set ip 10.10.10.1/32 .254 end
Set remote-ip 10.10.10.254/24 config vpn ipsec phase2-interface
isp1
edit "toSpokes"
198.51.100.0/24
The remote-ip is an unused IP from the set phase1name "toSpokes"
overlay subnet overlay set proposal aes128-sha1
next
toHub 10.10.10.0/24 toHub end
10.10.10.2/24 10.10.10.3/24 config system interface
edit "toSpokes"
Spoke02 .2 Spoke03 .3
set ip 10.10.10.1/32
set remote-ip 10.10.10.254/24
.254 .254
next
end
192.168.2.0/24 192.168.3.0/24
.1 .1
NEW
29
Hub IPsec configuration
config vpn ipsec phase1-interface
edit "toSpokes"
auto-discovery-sender enable set type dynamic
.1
set net-device disable
192.168.1.0/24
Required if ADVPN is desired set tunnel-search nexthop
Hub set interface "wan"
set proposal aes128-sha1
Detailed information about ADVPN is available in set add-route disable
KB article FD39360 10.10.10.1/24
.1 set exchange-interface-ip enable
toSpokes set auto-discovery-sender enable
https://kb.fortinet.com/kb/documentLink.do?externalID=FD39360 set psksecret xxxxxxxx
next
.254 end
exchange-interface-ip enable
isp1 config vpn ipsec phase2-interface
edit "toSpokes"
For learning the overlay IPs of the Spokes during IKE negotiation 198.51.100.0/24
set phase1name "toSpokes"
set proposal aes128-sha1
Automatically enabled when ADVPN next
toHub toHub end
is activated with
‘auto-discovery-sender enable’ 10.10.10.2/24 10.10.10.3/24 config system interface
edit "toSpokes"
Spoke02 .2 Spoke03 .3
set ip 10.10.10.1/32
set remote-ip 10.10.10.254/24
.254 .254
next
end
192.168.2.0/24 192.168.3.0/24
.1 .1
30
Spoke IPsec configuration
config vpn ipsec phase1-interface
edit "toHub"
/24 set interface "wan"
.1
set proposal aes128-sha1
The overlay IPs of all ADVPN participants are in the same 192.168.1.0/24 set exchange-interface-ip enable
subnet Hub set auto-discovery-receiver enable
set add-route disable
set remote-gw 198.51.100.1
The mask for the local ip can only be /32 10.10.10.1 set psksecret xxxxxxxx
.1
So, the mask for the overlay subnet toSpokes next
must be specified in ‘remote-ip’ end
.1 .1
31
Spoke IPsec configuration
config vpn ipsec phase1-interface
auto-discovery-receiver enable edit "toHub"
set interface "wan"
add-route disable .1
set proposal aes128-sha1
192.168.1.0/24 set exchange-interface-ip enable
Required if ADVPN is desired Hub set auto-discovery-receiver enable
set add-route disable
set remote-gw 198.51.100.1
Detailed information about ADVPN is available in 10.10.10.1 set psksecret xxxxxxxx
KB article FD39360 .1
next
toSpokes end
https://kb.fortinet.com/kb/documentLink.do?externalID=FD39360
.254 config vpn ipsec phase2-interface
edit "toHub"
exchange-interface-ip enable isp1 set phase1name "toHub"
set proposal aes128-sha1
198.51.100.0/24 next
Instructs the Spoke to announce its overlay IP (10.10.10.2) end
to the Hub during IKE negotiation.
toHub toHub config system interface
Automatically enabled when ADVPN edit "toHub"
10.10.10.2/24 10.10.10.3 set ip 10.10.10.2/32
is activated
with ‘auto-discovery-sender enable’ Spoke02 .2 Spoke03 .3 set remote-ip 10.10.10.1/24
next
end
.254 .254
192.168.2.0/24 192.168.3.0/24
.1 .1
32
Hub BGP configuration
config router bgp
set as 65000 .1
set router-id 10.10.10.1 192.168.1.0/24
config neighbor-group Hub BGP Route Reflector
edit "advn_peers"
set remote-as 65000 10.10.10.1
set route-reflector-client enable .1
toSpokes
next
end
config neighbor-range .254
edit 1
set prefix 10.10.10.0 255.255.255.0 iBGP ASisp1
65000 iBGP
198.51.100.0/24
set neighbor-group "advn_peers"
next
end toHub overlay toHub
config network 10.10.10.0/24
10.10.10.2 10.10.10.3
edit 1
set prefix 192.168.1.0 255.255.255.0 Spoke02 .2 Spoke03 .3
next
end
RR-Client RR-Client
.254 .254
end
192.168.2.0/24 192.168.3.0/24
.1 .1
33
Spoke BGP configuration
.1
192.168.1.0/24
Hub BGP Route Reflector
10.10.10.1
.1
toSpokes
edit "10.10.10.1"
set remote-as 65000 toHub overlay toHub
next 10.10.10.0/24
end 10.10.10.2 10.10.10.3
config network Spoke02 .2 Spoke03 .3
edit 1
set prefix 192.168.2.0 255.255.255.0 RR-Client RR-Client
next .254 .254
end 192.168.2.0/24 192.168.3.0/24
end
.1 .1
34
New IPsec dialup logic
With OSPF
Overlay IPs
Overlay IPs of the Spokes (10.10.10.x) can be provisioned in two ways:
.1
192.168.1.0/24
.254
▪ Manually on each Spoke Paris
config system interface config system interface
HUB edit "toSpokes" Spoke edit "toHub" 10.10.10.1
.1
set ip 10.10.10.1/32 set ip 10.10.10.2/32 toSpokes_0 toSpokes_1
set remote-ip 10.10.10.254/24 set remote-ip 10.10.10.1/24
next next
.254
end end
ISP1
▪ Automatically from the Hub using IKE mode-config as of FOS 6.2.2 198.51.100.0/24
37
Spoke OSPF configuration Support for NATed
Spokes available only
as of FortiOS 6.2
.1
and FortiOS 6.0.5
192.168.1.0/24
config router ospf
set router-id 10.10.10.2 Hub
config area
edit 0.0.0.0 10.10.10.1
.1
next toSpokes
end OSPF point-to-multipoint
config ospf-interface
.254
edit "toHub"
set interface "toHub" Areaisp1
0.0.0.0
set network-type point-to-point 198.51.100.0/24
set mtu-ignore enable
next OSPF point-to-point overlay OSPF point-to-point
end toHub toHub
10.10.10.0/24
config network 10.10.10.2 10.10.10.3
edit 1
set prefix 10.10.10.0 255.255.255.0 Spoke02 .2 Spoke03 .3
next
edit 2 .254 .254
set prefix 192.168.2.0 255.255.255.0
192.168.2.0/24 192.168.3.0/24
next
end .1 .1
end
38
New IPsec dialup logic
With IKE routes (a.k.a, reverse-route injection - RRI)
Restrictions for “net-device disable” with IKE routes
The subnets protected by the
Spokes are learned from the traffic
selectors of the IPsec SA negotiation
▪ Up to FortiOS 6.2.0 The Hub can learn a given subnet only once
Not
Supported HUB
phase1
Not
Supported HUB
phase1
Not
Supported
phase1
HUB
phase1
“I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting
192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24”
▪ As of FortiOS 6.2.1 The Hub can learn a given subnet once per phase1
✓
Not
Supported HUB
Not
Supported HUB
phase1
Supported
phase1
HUB
phase1
phase1
“I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting “I’m protecting
192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24” 192.168.2.0/24”
.254 .254
192.168.2.0/24 192.168.3.0/24
.1 .1
41
Spoke IPsec & routing configuration
src-subnet <protected-subnet> config vpn ipsec phase1-interface
.1
edit "toHub"
The Spoke must announce each protected subnet 192.168.1.0/24
set interface "wan"
during IPsec SA negotiation Hub set proposal aes128-sha1
set remote-gw 198.51.100.1
set psksecret xxxxxxxx
toSpokes
.1 next
end
.254 .254
42
Spoke IPsec & routing configuration
Announcing multiple protected subnets with IKEv1 Announcing multiple protected subnets with IKEv2
45
IKE routes (reverse route injection)
▪ Packets forwarded to shared interface toSpokes
S 192.168.2.0/24 [15/0] via 198.51.100.2, toSpokes
46
IKE routes (reverse route injection)
▪ Packets forwarded to shared interface toSpokes (cont.):