Used Red Hat 8.5
libreswan.x86_64 4.4-4.el8_5
Please use the official documentation from libreswan
https://libreswan.org/wiki/Route-base...
NOTE: You have to refer to my previous video in which I explained everything about ipsec with certificates
• IPsec tunnel ( certificates + Redhat )
HOST A
========
conn mytunnel
left=192.168.30.2
right=192.168.30.1
authby=rsasig
leftsubnet=0.0.0.0/0
rightsubnet=0.0.0.0/0
auto=start
route-based VPN requires marking and an interface
mark=12/0xffffff
vti-interface=vti02
do not setup routing because we don't want to send 0.0.0.0/0 over the tunnel
vti-routing=no
If you run a subnet with BGP (quagga) daemons over IPsec, you can configure the VTI interface
leftvti=10.0.1.1/30
ikev2=insist
leftcert="NSS Certificate DB:hosta - mrwhitebp"
rightid=%fromcert
rightca="NSS Certificate DB:mrwhitebp - mrwhitebp"
HOST B
========
conn mytunnel
left=192.168.30.1
right=192.168.30.2
authby=rsasig
leftsubnet=0.0.0.0/0
rightsubnet=0.0.0.0/0
auto=start
route-based VPN requires marking and an interface
mark=12/0xffffff
vti-interface=vti02
do not setup routing because we don't want to send 0.0.0.0/0 over the tunnel
vti-routing=no
If you run a subnet with BGP (quagga) daemons over IPsec, you can configure the VTI interface
leftvti=10.0.1.2/30
ikev2=insist
leftcert="NSS Certificate DB:hostb - mrwhitebp"
rightid=%fromcert
rightca="NSS Certificate DB:mrwhitebp - mrwhitebp"