Description:
I am learning how to configure ipsec with libreswan. I want to set up a host-to-host vpn between two hosts. I want each host to use a virtual interface for their ipsec tunnel.
Problem:
I set up my ipsec configuration with RSA, and started the tunnel, however no virtual interface was built.
System:
(2) RHEL 8.2 virtual machines
Whats not clear to me
- How do I start the tunnel? I get that I run
ipsec auto --up mytunnel
, however does that command need to be run on both systems at the same time or on the right first then the left? - My "left" and "right" ips are ip addresses configuring on interfaces that can route to each other. Is this correct?
- I feel like I am missing a step here, like configuring an interfaces and setting up libreswan to use it possibly?
Troubleshooting:
- I followed these instructions on how to set up the ipsec tunnel.
- I confirmed with netstat, seems all interfaces are listening on 500 and 4500.
- Performed a
ip a
, I see no virtual interface being created. - To start the tunnel I run
systemctl restart ipsec.service
, thenipsec auto --up mytunnel
, and lastlyipsec auto --up mytunnel
, I see this output
181 "mytunnel" #1: initiating IKEv2 IKE SA
181 "mytunnel" #1: STATE_PARENT_I1: sent v2I1, expected v2R1
182 "mytunnel" #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=DH19}
002 "mytunnel" #2: IKEv2 mode peer ID is ID_FQDN: '@west'
003 "mytunnel" #2: Authenticated using RSA with IKEv2_AUTH_HASH_SHA1
002 "mytunnel" #2: negotiated connection [10.10.10.111-10.10.10.112:0-65535 0] -> [10.10.10.111-10.10.10.112:0-65535 0]
004 "mytunnel" #2: STATE_V2_IPSEC_I: IPsec SA established transport mode {ESP=>0xe25ebdee <0x3d8ac123 xfrm=AES_GCM_16_256-NONE NATOA=none NATD=none DPD=passive}
My ipsec config:
conn mytunnel
auto=add
leftid=@west
left=10.10.10.111
leftrsasigkey=0sAwEAAbqd ... blqu1K0=
rightid=@east
right=10.10.10.112
rightrsasigkey=0sAwEAAboA ... NEJbLk=
authby=rsasig
EDIT Fixed my log output.
EDIT2 I learned that ipsec does not set up a virtual interface on its own. This needs to be done via IPIP, GRE, or other methods.