
ex1). OVS_Bridge#1 : 내부망 네트워크
ex2). OVS_Bridge#2 : 외부망 네트워크
ex1). OVS_Bridge#1을 사내의 VPN과 연동하여 사내 서비스 혹은 사내의 논리 단말로 사용.

Bridge#1 생성
# ovs-vsctl add-br br-ipsec
# ip addr add 10.10.10.1/24 dev br-ipsec
# ip link set br-ipsec up
-----------------------------------------------------------------------------
- 이 시점에서 단말에 라우팅 룰이 잡힌다
10.10.10.0/24 dev br-ipsec proto kernel scope link src 10.10.10.1
Bridge#2 생성
# ovs-vsctl add-br br-ipsec2
# ip addr add 10.0.0.1/24 dev br-ipsec2
# ip link set br-ipsec2 up
-----------------------------------------------------------------------------
- 이 시점에서 단말에 라우팅 룰이 잡힌다
10.0.0.0/24 dev br-ipsec2 proto kernel scope link src 10.0.0.1
Bridge#1과 VPN 연동
# ovs-vsctl add-port br-ipsec tun
# ovs-vsctl set interface tun type=gre options:remote_ip=$Eth#3 options:psk= "TestString"
# ovs-vsctl set interface tun options:ipsec_encapsulation=yes
# ovs-vsctl set Interface tun options:local_ip=$Eth#1
-----------------------------------------------------------------------------
- IPSec Handshake 방식은 PSK로 진행.
- OVS 커맨드를 통한 이 시점에서 strongswan이 사용하는 /etc/ipsec.conf에 필요한 값들이 설정된다.
- strongswan의 config를 직접 작성하지 않아도 OVS를 통해 IPsec을 구성하면 얻을 수 있는 장점이다.
Bridge#2과 VPN 연동
# ovs-vsctl add-port br-ipsec2 tun2
# ovs-vsctl set interface tun2 type=gre options:remote_ip=$Eth#4 options:psk="TestString"
# ovs-vsctl set interface tun2 options:ipsec_encapsulation=yes
# ovs-vsctl set Interface tun2 options:local_ip=$Eth#2
-----------------------------------------------------------------------------
- IPSec Handshake 방식은 PSK로 진행.
- 위 구성도처럼 nic이 1개인 경우 sub ip를 추가한 후 설정
라우팅 룰 생성
VM 단말 구성 결과


네트워크망 단말 구성(구성도상 우측 단말 2EA)
Network#1
Bridge#1 생성
# ovs-vsctl add-br br-ipsec
# ip addr add 10.10.10.2/24 dev br-ipsec
# ip link set br-ipsec up
-----------------------------------------------------------------------------
# ovs-vsctl add-port br-ipsec tun
# ovs-vsctl set interface tun type=gre options:remote_ip=$Eth#1 options:psk= "TestString"
# ovs-vsctl set interface tun options:ipsec_encapsulation=yes
# ovs-vsctl set Interface tun options:local_ip=$Eth#3
-----------------------------------------------------------------------------
Network#2
Bridge#1 생성
# ovs-vsctl add-br br-ipsec
# ip addr add 10.0.0.2/24 dev br-ipsec
# ip link set br-ipsec up
-----------------------------------------------------------------------------
# ovs-vsctl add-port br-ipsec tun
# ovs-vsctl set interface tun type=gre options:remote_ip=$Eth#2 options:psk= "TestString"
# ovs-vsctl set interface tun options:ipsec_encapsulation=yes
# ovs-vsctl set Interface tun options:local_ip=$Eth#4
-----------------------------------------------------------------------------


"Ping 8.8.8.8" 패킷 flow

원격지 Network 기반 통신 확인
Nested VPN 작동 확인
존경합니다