blob: 1b32226965f5af10d28913db5f2ab169dc1a70df [file] [log] [blame]
Filip Tehlard5a33802021-02-20 02:26:17 +00001ip table add 1
2
3create host-interface name gw1
4set interface ip addr host-gw1 192.168.10.2/24
5set interface state host-gw1 up
6
7create host-interface name gw2
8set int ip table host-gw2 1
9set interface ip addr host-gw2 192.168.10.2/24
10set interface state host-gw2 up
11
12create host-interface name priv1
13set interface ip addr host-priv1 192.168.3.1/24
14set interface state host-priv1 up
15
16create host-interface name priv2
17set int ip table host-priv2 1
18set interface ip addr host-priv2 192.168.3.1/24
19set interface state host-priv2 up
20
21ikev2 profile add pr1
22ikev2 profile set pr1 auth shared-key-mic string Vpp123
23ikev2 profile set pr1 id local fqdn vpp.home
24ikev2 profile set pr1 id remote fqdn roadwarrior1.vpn.example.com
25ikev2 profile set pr1 traffic-selector local ip-range 192.168.3.0 - 192.168.3.255 port-range 0 - 65535 protocol 0
26ikev2 profile set pr1 traffic-selector remote ip-range 192.168.5.0 - 192.168.5.255 port-range 0 - 65535 protocol 0
27create ipip tunnel src 192.168.10.2 dst 192.168.10.1
28ikev2 profile set pr1 tunnel ipip0
29ip route add 192.168.5.0/24 via 192.168.10.1 ipip0
30set interface unnumbered ipip0 use host-gw1
31
32ikev2 profile add pr2
33ikev2 profile set pr2 auth shared-key-mic string Vpp123
34ikev2 profile set pr2 id local fqdn vpp.home
35ikev2 profile set pr2 id remote fqdn roadwarrior2.vpn.example.com
36ikev2 profile set pr2 traffic-selector local ip-range 192.168.3.0 - 192.168.3.255 port-range 0 - 65535 protocol 0
37ikev2 profile set pr2 traffic-selector remote ip-range 192.168.5.0 - 192.168.5.255 port-range 0 - 65535 protocol 0
38create ipip tunnel src 192.168.10.2 dst 192.168.10.1 outer-table-id 1
39set interface ip table ipip1 1
40ikev2 profile set pr2 tunnel ipip1
41ip route add table 1 192.168.5.0/24 via 192.168.10.1 ipip1
42set interface unnumbered ipip1 use host-gw2
43
44ikev2 set liveness 300 4
45ikev2 set logging level 4
46event-logger clear
47trace add af-packet-input 100
48