お疲れさまです
Ciscoでは仕事で何度かGREoverIPSECの設定を実施したのですが、、Junosでは実は設定したことなかったので自宅環境で実施してみました!!
日本語ではなかなか良いコンテンツがなく英語でもホントにこの設定??みたいな感じでしたが・・(^^;)
Juniper公式?Youtube上にあった動画が参考になりました(^^;)
参考にした動画
configはgithub上に上げました!
(まだ整理できてません。。 取り急ぎUPしたので内容は修正します)
https://github.com/gorosuke5656/junos-lab/tree/main/JSEC
gre-over-ipsec-ospf(100H2).cfg
gre-over-ipsec-ospf(100B).cfg
の2つになります。。
★ 構成
いつもの構成です(^^;)
前回GREトンエル設定した構成をそのまま使用しています!
https://gorosuke5656.hatenablog.com/entry/2023/03/19/142750
★設定時のポイント
〇 GREインタフェースのソースIPアドレスとst0インタフェースのアドレスを同じにする。
【SRX100Bの場合】
admin@SRX100B> show configuration interfaces gr-0/0/0 | display set
set interfaces gr-0/0/0 unit 0 tunnel source 172.16.7.1
set interfaces gr-0/0/0 unit 0 tunnel destination 172.16.8.1
set interfaces gr-0/0/0 unit 0 family inet
admin@SRX100B> show configuration interfaces st0.0 | display set
set interfaces st0 unit 0 family inet address 172.16.7.1/32
【SRX100H2の場合】
SRX100H2においてはバーチャルルータ”VR1”上に設定
admin@SRX100H2> show configuration interfaces gr-0/0/0 | display set
set interfaces gr-0/0/0 unit 0 tunnel source 172.16.8.1
set interfaces gr-0/0/0 unit 0 tunnel destination 172.16.7.1
set interfaces gr-0/0/0 unit 0 tunnel routing-instance destination VR1
set interfaces gr-0/0/0 unit 0 family inet
admin@SRX100H2> show configuration interfaces st0.0 | display set
set interfaces st0 unit 0 family inet address 172.16.8.1/32
admin@SRX100H2>
〇 セキュリティゾーン”VPN” を作成しGREインタフェースとst0.0インタフェースを同じゾーンにする
(もちろんゾーン”VPN”を通過するトラヒックはセキュリティポリシーで許可する)
【SRX100Bの場合】
admin@SRX100B> show configuration security zones security-zone vpn | display set
set security zones security-zone vpn host-inbound-traffic system-services all
set security zones security-zone vpn host-inbound-traffic protocols all
set security zones security-zone vpn interfaces st0.0
set security zones security-zone vpn interfaces gr-0/0/0.0
【SRX100H2の場合】
admin@SRX100H2> show configuration security zones security-zone vpn | display set
set security zones security-zone vpn host-inbound-traffic system-services all
set security zones security-zone vpn host-inbound-traffic protocols all
set security zones security-zone vpn interfaces st0.0
set security zones security-zone vpn interfaces gr-0/0/0.0
ホントは許可プロトコルをike絞る方がベストですが今回は検証なんでご勘弁を・・(^^;)
★設定後の確認
SRXで統計情報をクリアしておきます(念のため)
admin@SRX100B> clear interfaces statistics gr-0/0/0
admin@SRX100B> clear security ipsec statistics
UbuntoからPing&Tracerouteを実施しました!!
SRXで確認しました!!
(GREトンネルカウンタとIPSECパケットのカウンターが上がっています)
admin@SRX100B> show interfaces gr-0/0/0.0
Logical interface gr-0/0/0.0 (Index 74) (SNMP ifIndex 532)
Flags: Point-To-Point SNMP-Traps 0x0
IP-Header 172.16.8.1:172.16.7.1:47:df:64:0000000000000000
Encapsulation: GRE-NULL
Gre keepalives configured: Off, Gre keepalives adjacency state: up
Input packets : 11
Output packets: 11
Security: Zone: vpn
Allowed host-inbound traffic : bootp bfd bgp dns dvmrp igmp ldp msdp nhrp
ospf pgm pim rip router-discovery rsvp sap vrrp dhcp finger ftp tftp
ident-reset http https ike netconf ping reverse-telnet reverse-ssh rlogin
rpm rsh snmp snmp-trap ssh telnet traceroute xnm-clear-text xnm-ssl lsping
ntp sip r2cp
Protocol inet, MTU: 1476
Flags: Sendbcast-pkt-to-re
admin@SRX100B> show interfaces gr-0/0/0.0
Logical interface gr-0/0/0.0 (Index 74) (SNMP ifIndex 532)
Flags: Point-To-Point SNMP-Traps 0x0
IP-Header 172.16.8.1:172.16.7.1:47:df:64:0000000000000000
Encapsulation: GRE-NULL
Gre keepalives configured: Off, Gre keepalives adjacency state: up
Input packets : 12
Output packets: 12
Security: Zone: vpn
Allowed host-inbound traffic : bootp bfd bgp dns dvmrp igmp ldp msdp nhrp
ospf pgm pim rip router-discovery rsvp sap vrrp dhcp finger ftp tftp
ident-reset http https ike netconf ping reverse-telnet reverse-ssh rlogin
rpm rsh snmp snmp-trap ssh telnet traceroute xnm-clear-text xnm-ssl lsping
ntp sip r2cp
Protocol inet, MTU: 1476
Flags: Sendbcast-pkt-to-re
admin@SRX100B> show security ipsec statistics
ESP Statistics:
Encrypted bytes: 6080
Decrypted bytes: 3360
Encrypted packets: 40
Decrypted packets: 40
AH Statistics:
Input bytes: 0
Output bytes: 0
Input packets: 0
Output packets: 0
Errors:
AH authentication failures: 0, Replay errors: 0
ESP authentication failures: 0, ESP decryption failures: 0
Bad headers: 0, Bad trailers: 0
admin@SRX100B> show security ipsec statistics
ESP Statistics:
Encrypted bytes: 6232
Decrypted bytes: 3444
Encrypted packets: 41
Decrypted packets: 41
AH Statistics:
Input bytes: 0
Output bytes: 0
Input packets: 0
Output packets: 0
Errors:
AH authentication failures: 0, Replay errors: 0
ESP authentication failures: 0, ESP decryption failures: 0
Bad headers: 0, Bad trailers: 0
admin@SRX100B>
〇 UbuntoからNS-50に対して以下を実施しました
curlコマンドでWebサーバ(http://172.16.10.1)にアクセス
pingを172.16.10.1に対して実施
その際のSRX100H2のPolicyログになります!
admin@SRX100H2> show log PolicyLog
Mar 21 18:19:18 SRX100H2 clear-log[1671]: logfile cleared
Mar 21 18:19:27 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/52478->172.16.10.1/80 junos-http 130.230.0.1/52478->172.16.10.1/80 None None 6 vpn_to_LAN vpn LAN 277 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
Mar 21 18:20:26 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/1->172.16.10.1/2363 icmp 130.230.0.1/1->172.16.10.1/2363 None None 1 vpn_to_LAN vpn LAN 278 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
Mar 21 18:20:27 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/2->172.16.10.1/2363 icmp 130.230.0.1/2->172.16.10.1/2363 None None 1 vpn_to_LAN vpn LAN 279 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
Mar 21 18:20:28 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/3->172.16.10.1/2363 icmp 130.230.0.1/3->172.16.10.1/2363 None None 1 vpn_to_LAN vpn LAN 280 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
Mar 21 18:20:29 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/4->172.16.10.1/2363 icmp 130.230.0.1/4->172.16.10.1/2363 None None 1 vpn_to_LAN vpn LAN 281 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
Mar 21 18:20:30 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/5->172.16.10.1/2363 icmp 130.230.0.1/5->172.16.10.1/2363 None None 1 vpn_to_LAN vpn LAN 282 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
Mar 21 18:20:31 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/6->172.16.10.1/2363 icmp 130.230.0.1/6->172.16.10.1/2363 None None 1 vpn_to_LAN vpn LAN 283 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
〇 UbuntoからNS-50に対してTelnetを実施しました
gorosuke@ubuntu:~$ telnet 172.16.10.1
Trying 172.16.10.1...
Connected to 172.16.10.1.
Escape character is '^]'.
Remote Management Console
login:
admin@SRX100H2> show security flow session | match 172.16.10.1
In: 130.230.0.1/54410 --> 172.16.10.1/23;tcp, If: st0.0, Pkts: 7, Bytes: 353
Out: 172.16.10.1/23 --> 130.230.0.1/54410;tcp, If: fe-0/0/3.0, Pkts: 7, Bytes: 354
admin@SRX100H2> show log PolicyLog
Mar 21 18:39:30 SRX100H2 clear-log[1751]: logfile cleared
Mar 21 18:39:57 SRX100H2 RT_FLOW: %USER-6-RT_FLOW_SESSION_CREATE: session created 130.230.0.1/54410->172.16.10.1/23 junos-telnet 130.230.0.1/54410->172.16.10.1/23 None None 6 vpn_to_LAN vpn LAN 308 N/A(N/A) st0.0 UNKNOWN UNKNOWN UNKNOWN
admin@SRX100H2>
st0.0インタフェースを経由していることがわわかります!
OSPFも稼働させて、GREトンネル経由でネイバー確率と経路情報をやり取りしているのを確認しています~(^^;)
VPNまだいろいろやりたいけど一旦休憩してBGP演習を実施したいと思います!!