LibReSwanを使って IPSec(+ VRRP) の評価環境を作成中です。構成は図の通りで、全6ノードともCentOS7です。網掛けの部分は今回の問題とは関係ないので無視してください。現在、切り分けのため vs2/vc2 の VM 自体、および vs1/vc1 の keepalived は停止中です。仮想化基盤は Vagrant+VirtualBox を使っています。
問題としては、末端ノードである vn-c から vn-s への ping(ICMP) は通りますが、http/tcp と snmp/udp が通りません。その逆も同様です。
IPSec ノードである vs1/vc1 双方で firewalld を止めれば通るようになるので、firewalld のルールの問題だろうと思っています。Qiita でも同様と思われる書き込みがありました。
本件について、ご助言をいただければ幸甚です。
【firewalld】
bash
1vagrant@vs1:~$ sudo firewall-cmd --list-all 2public (active) 3 target: default 4 icmp-block-inversion: no 5 interfaces: eth0 eth1 eth2 eth3 6 sources: 7 services: dhcpv6-client dns http https ipsec snmp snmptrap squid ssh 8 ports: 9 protocols: 10 masquerade: no 11 forward-ports: 12 source-ports: 13 icmp-blocks: 14 rich rules: 15 rule protocol value="vrrp" accept 16
(vs1/vc1 とも同様)
末端ノード側。関係ないと思いますが一応。
vagrant@vn-s:~$ sudo firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: eth0 eth1 eth2 sources: services: dhcpv6-client http https snmp snmptrap ssh ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
(vn-c も同様)
【経路情報】
bash
1vagrant@vs1:~/vpn-deploy$ ip r 2default via 10.0.2.2 dev eth0 proto dhcp metric 100 310.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 metric 100 4172.16.1.0/24 dev eth2 proto kernel scope link src 172.16.1.11 metric 104 5172.16.3.0/24 dev eth3 proto kernel scope link src 172.16.3.11 metric 103 6172.16.4.0/24 via 172.16.1.21 dev eth2 proto static metric 104 7192.168.56.0/24 dev eth1 proto kernel scope link src 192.168.56.11 metric 101 8
bash
1vagrant@vc1:~$ ip r 2default via 10.0.2.2 dev eth0 proto dhcp metric 100 310.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 metric 100 4172.16.1.0/24 dev eth2 proto kernel scope link src 172.16.1.21 metric 104 5172.16.3.0/24 via 172.16.1.11 dev eth2 proto static metric 104 6172.16.4.0/24 dev eth3 proto kernel scope link src 172.16.4.21 metric 103 7192.168.56.0/24 dev eth1 proto kernel scope link src 192.168.56.14 metric 101 8
bash
1vagrant@vn-s:~$ ip r 2default via 172.16.3.11 dev eth2 proto static metric 104 3172.16.3.0/24 dev eth2 proto kernel scope link src 172.16.3.13 metric 104 4192.168.56.0/24 dev eth1 proto kernel scope link src 192.168.56.13 metric 103 5
bash
1vagrant@vn-c:~$ ip r 2default via 172.16.4.21 dev eth2 proto static metric 104 3172.16.4.0/24 dev eth2 proto kernel scope link src 172.16.4.23 metric 104 4192.168.56.0/24 dev eth1 proto kernel scope link src 192.168.56.16 metric 103 5
【IPSec関連】
bash
1vagrant@vs1:~$ sudo ipsec verify 2Verifying installed system and configuration files 3 4Version check and ipsec on-path [OK] 5Libreswan 3.25 (netkey) on 3.10.0-1127.8.2.el7.x86_64 6Checking for IPsec support in kernel [OK] 7 NETKEY: Testing XFRM related proc values 8 ICMP default/send_redirects [OK] 9 ICMP default/accept_redirects [OK] 10 XFRM larval drop [OK] 11Pluto ipsec.conf syntax [OK] 12Two or more interfaces found, checking IP forwarding [OK] 13Checking rp_filter [OK] 14Checking that pluto is running [OK] 15 Pluto listening for IKE on udp 500 [OK] 16 Pluto listening for IKE/NAT-T on udp 4500 [OK] 17 Pluto ipsec.secret syntax [OK] 18Checking 'ip' command [OK] 19Checking 'iptables' command [OK] 20Checking 'prelink' command does not interfere with FIPS [OK] 21Checking for obsolete ipsec.conf options [OK] 22
(vn1も同様)
bash
1vagrant@vs1:~$ sudo cat /etc/ipsec.d/ipsec.conf 2conn conn-s 3 auto=ondemand 4 type=tunnel 5 authby=secret 6 keyexchange=ike 7 ike=AES256-SHA2;DH19 8 pfs=no 9 rekey=no 10 keyingtries=1 11 dpddelay=5 12 dpdtimeout=10 13 dpdaction=clear 14 # 15 left=172.16.1.11 16 leftsubnets={ 172.16.3.0/24 } 17 right=172.16.1.21 18 rightsubnets={ 172.16.4.0/24 } 19
bash
1vagrant@vs1:~$ sudo ipsec status | grep erouted 2000 "conn-s/1x1": 172.16.3.0/24===172.16.1.11<172.16.1.11>...172.16.1.21<172.16.1.21>===172.16.4.0/24; erouted; eroute owner: #2 3
bash
1vagrant@vc1:~$ sudo cat /etc/ipsec.d/ipsec.conf 2conn conn-c 3 auto=ondemand 4 type=tunnel 5 authby=secret 6 keyexchange=ike 7 ike=AES256-SHA2;DH19 8 pfs=no 9 rekey=no 10 keyingtries=1 11 dpddelay=5 12 dpdtimeout=10 13 dpdaction=clear 14 # 15 left=172.16.1.21 16 leftsubnets={ 172.16.4.0/24 } 17 right=172.16.1.11 18 rightsubnets={ 172.16.3.0/24 } 19
bash
1vagrant@vc1:~$ sudo ipsec status | grep erouted 2000 "conn-c/1x1": 172.16.4.0/24===172.16.1.21<172.16.1.21>...172.16.1.11<172.16.1.11>===172.16.3.0/24; erouted; eroute owner: #2 3
【試したこと】
bash
1vagrant@vs1:~$ sudo firewall-cmd --set-log-denied=unicast 2success 3vagrant@vs1:~$ sudo tail -f /var/log/messages 4Jun 25 09:21:43 vs1 firewalld[10660]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now. 5(特に出力なし) 6
bash
1vagrant@vc1:~$ sudo firewall-cmd --set-log-denied=unicast 2success 3vagrant@vc1:~$ sudo tail -f /var/log/messages 4Jun 25 09:23:55 vc1 firewalld[10592]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now. 5Jun 25 09:25:23 vc1 kernel: FINAL_REJECT: IN=eth3 OUT=eth2 MAC=08:00:27:a8:46:17:08:00:27:26:d4:fb:08:00 SRC=172.16.4.23 DST=172.16.3.13 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=3519 DF PROTO=TCP SPT=51714 DPT=80 WINDOW=29200 RES=0x00 SYN URGP=0 6
AllowZoneDrifting は将来無効になるとのことですが、とりあえず CentOS7 の libreswan-3.25-8.1.el7_7.x86_64 のデフォルトのままとしています。
【ipsec サービス定義】
vagrant@vs1:~$ cat /usr/lib/firewalld/services/ipsec.xml <?xml version="1.0" encoding="utf-8"?> <service> <short>IPsec</short> <description>Internet Protocol Security (IPsec) incorporates security for network transmissions directly into the Internet Protocol (IP). IPsec provides methods for both encrypting data and authentication for the host or network it sends to. If you plan to use a vpnc server or FreeS/WAN, do not disable this option.</description> <port protocol="ah" port=""/> <port protocol="esp" port=""/> <port protocol="udp" port="500"/> <port protocol="udp" port="4500"/> </service> ```(デフォルトのまま)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/25 05:15
2020/06/25 05:44
2020/06/25 05:57
2020/06/25 06:04
2022/02/23 00:14