Traffic selectors
Selectors choose what is encrypted
Lesson 4 of 20 · 11 min · Module 1: A private path over a public network
The gateways can agree on every algorithm and still disagree about the one thing the tunnel is for: which traffic goes through it.
Start this lesson →Free. No installation: you write and run the code in your browser, and it is checked automatically.
By the end, you’ll be able to…
- Write a selector as local network, then remote network
- Explain why the two sides mirror each other
- Recognise TS_UNACCEPTABLE
The idea
A traffic selector is a pair: the local network and the remote network. The two gateways hold mirror images of each other: what is local here is remote there. If the peer cannot accept any of your selectors, it answers TS_UNACCEPTABLE and no child SA is created.
# head office # branch
selector 10.0.1.0/24 10.1.0.0/24 # selector 10.1.0.0/24 10.0.1.0/24
01Local first, remote second
In this format the first network is the one behind this gateway and the second is the one behind the peer. The branch administrator writes the same two networks the other way round.
02A typo here hides well
10.1.0.0/24 and 10.10.0.0/24 look alike, and every other part of the tunnel can be right. The IKE SA comes up, authentication succeeds, and only the last stage fails. In older IKEv1 setups the same mistake appears as a phase 2 failure.
03Selectors on real devices
Policy-based VPNs use an ACL or a pair of subnets as the selector. Route-based VPNs use a tunnel interface with wide selectors and decide by routing what enters it.
# FortiGate
config vpn ipsec phase2-interface
edit "to-branch-p2"
set src-subnet 10.0.1.0 255.255.255.0
set dst-subnet 10.1.0.0 255.255.255.0
next
end
# Huawei USG
acl number 3000
rule 5 permit ip source 10.0.1.0 0.0.0.255 destination 10.1.0.0 0.0.0.255
# See the installed selectors
# FortiGate: diagnose vpn tunnel list
# Huawei USG: display ipsec sa
# Cisco IOS: show crypto ipsec sa
Your turn
What the checks look for
- The child SA is created
- Traffic between the offices is encrypted
- The selector is exactly the two office networks
- Other private networks are not sent into this tunnel
Take this with you
A selector is local network, then remote network, mirrored on the other side. If they do not correspond, the child SA is refused.
Go a little further
Change the local network in the selector to 10.0.2.0/24 and read which test packets change from TUNNEL to DROP.