Guest User

Untitled

a guest
Oct 30th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.00 KB | None | 0 0
  1. EC2 instance - running CentOS7
  2. Public IP: A.B.C.D
  3. Private IP: E.F.G.H
  4.  
  5. [toor@ip-E-F-G-H ~]# lsb_release -a
  6. LSB Version: :core-4.1-amd64:core-4.1-noarch
  7. Distributor ID: CentOS
  8. Description: CentOS Linux release 7.5.1804 (Core)
  9. Release: 7.5.1804
  10. Codename: Core
  11.  
  12. [toor@ip-E-F-G-H ~]# ipsec version
  13. Linux Libreswan 3.23 (netkey) on 3.10.0-862.3.2.el7.x86_64
  14.  
  15. [toor@ip-E-F-G-H ~]# ipsec version
  16. Verifying installed system and configuration files
  17.  
  18. Version check and ipsec on-path [OK]
  19. Libreswan 3.23 (netkey) on 3.10.0-862.3.2.el7.x86_64
  20. Checking for IPsec support in kernel [OK]
  21. NETKEY: Testing XFRM related proc values
  22. ICMP default/send_redirects [OK]
  23. ICMP default/accept_redirects [OK]
  24. XFRM larval drop [OK]
  25. Pluto ipsec.conf syntax [OK]
  26. Two or more interfaces found, checking IP forwarding [OK]
  27. Checking rp_filter [OK]
  28. Checking that pluto is running [OK]
  29. Pluto listening for IKE on udp 500 [OK]
  30. Pluto listening for IKE/NAT-T on udp 4500 [OK]
  31. Pluto ipsec.secret syntax [OK]
  32. Checking 'ip' command [OK]
  33. Checking 'iptables' command [OK]
  34. Checking 'prelink' command does not interfere with FIPS [OK]
  35. Checking for obsolete ipsec.conf options [OK]
  36.  
  37. config setup
  38. logfile=/var/log/pluto.log
  39. virtual_private=%v4:M.N.O.P/32,%v4:Q.R.S.T/32 #are encryption Domain of my peer
  40. protostack=netkey
  41.  
  42. conn MyConnection
  43. authby=secret
  44. auto=start
  45. type=tunnel
  46. ## phase1 ##
  47. ike=aes256-sha1;modp2048
  48. keyexchange=ike
  49. ## phase2 ##
  50. phase2=esp
  51. phase2alg=aes256-sha1;modp2048
  52. compress=no
  53. pfs=yes
  54. left=%defaultroute
  55. leftid=A.B.C.D #MyPublic Ip on AWS EC2
  56. leftsourceip=E.F.G.H . #My private ip of my ec2 centos7 instance
  57. leftsubnet=E.F.G.H/32
  58. leftnexthop=%defaultroute
  59. ## MyPeer ##
  60. right=I.J.K.L #Public ip of the peer - cisco asa device
  61. rightsubnets={M.N.O.P/32,Q.R.S.T/32}
  62. ikelifetime=28800s
  63. salifetime=3600s
  64. aggrmode=no
  65.  
  66. my ipsec.secrets
  67. A.B.C.D I.J.K.L: PSK "*&^%$3434"
  68.  
  69. [toor@ip-E-F-G-H ~]# ipsec auto --status
  70.  
  71. 000 "MyConnection/0x2": IKE algorithms: AES_CBC_256-HMAC_SHA1-MODP1536
  72. 000 "MyConnection/0x2": IKE algorithm newest: AES_CBC_256-HMAC_SHA1-MODP1536
  73. 000 "MyConnection/0x2": ESP algorithms: AES_CBC_256-HMAC_SHA1_96-MODP1536
  74. 000 "MyConnection/0x2": ESP algorithm newest: AES_CBC_256-HMAC_SHA1_96; pfsgroup=MODP1536
  75. 000
  76. 000 Total IPsec connections: loaded 2, active 2
  77. 000
  78. 000 State Information: DDoS cookies not required, Accepting new IKE connections
  79. 000 IKE SAs: total(1), half-open(0), open(0), authenticated(1), anonymous(0)
  80. 000 IPsec SAs: total(2), authenticated(2), anonymous(0)
  81. 000
  82. 000 #2: "MyConnection/0x1":4500 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 734s; newest IPSEC; eroute owner; isakmp#1; idle; import:admin initiate
  83. 000 #2: "MyConnection/0x1" esp.bd6f5d5@I.J.K.L esp.e6e75a6@A.B.C.D tun.0@I.J.K.L tun.0@A.B.C.D ref=0 refhim=0 Traffic: ESPin=0B ESPout=4KB! ESPmax=4194303B
  84. 000 #1: "MyConnection/0x2":4500 STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 25692s; newest ISAKMP; lastdpd=0s(seq in:0 out:0); idle; import:admin initiate
  85. 000 #3: "MyConnection/0x2":4500 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 524s; newest IPSEC; eroute owner; isakmp#1; idle; import:admin initiate
  86. 000 #3: "MyConnection/0x2" esp.be78561f@I.J.K.L esp.21e1d536@A.B.C.D tun.0@I.J.K.L tun.0@A.B.C.D ref=0 refhim=0 Traffic: ESPin=0B ESPout=1KB! ESPmax=4194303B
  87. 000
  88. 000 Bare Shunt list:
  89. 000
  90.  
  91. [toor@ip-E-F-G-H ~]# route -n
  92. Kernel IP routing table
  93. Destination Gateway Genmask Flags Metric Ref Use Iface
  94. 0.0.0.0 E.F.0.1 0.0.0.0 UG 0 0 0 eth0
  95. M.N.O.P E.F.0.1 255.255.255.255 UGH 0 0 0 eth0
  96. Q.R.S.T E.F.0.1 255.255.255.255 UGH 0 0 0 eth0
  97. E.F.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
  98.  
  99. [root@ip-E-F-G-H ~]#ping M.N.O.P
  100. no reply
  101.  
  102. [root@ip-E-F-G-H ~]#ping Q.R.S.T
  103. no reply
  104.  
  105. [root@ip-E-F-G-H ~]#iptables -L
  106. Chain INPUT (policy ACCEPT)
  107. target prot opt source destination
  108. ACCEPT udp -- anywhere anywhere udp dpt:isakmp
  109. ACCEPT tcp -- anywhere anywhere tcp dpt:ipsec-nat-t
  110. ACCEPT udp -- anywhere anywhere udp dpt:ipsec-nat-t
  111. ACCEPT esp -- anywhere anywhere
  112. ACCEPT ah -- anywhere anywhere
  113.  
  114. Chain FORWARD (policy ACCEPT)
  115. target prot opt source destination
  116. ACCEPT all -- anywhere anywhere
  117. ACCEPT all -- anywhere anywhere
  118.  
  119. Chain OUTPUT (policy ACCEPT)
  120. target prot opt source destination
  121.  
  122. [root@ip-E-F-G-H ~]#iptables -t nat -L -v -n
  123. Chain PREROUTING (policy ACCEPT 19 packets, 1024 bytes)
  124. pkts bytes target prot opt in out source destination
  125.  
  126. Chain INPUT (policy ACCEPT 19 packets, 1024 bytes)
  127. pkts bytes target prot opt in out source destination
  128.  
  129. Chain OUTPUT (policy ACCEPT 305 packets, 127K bytes)
  130. pkts bytes target prot opt in out source destination
  131.  
  132. Chain POSTROUTING (policy ACCEPT 305 packets, 127K bytes)
  133. pkts bytes target prot opt in out source destination
  134.  
  135. Type Protocol Port Range Source Description
  136. All traffic All All M.N.O.P/32
  137. All traffic All All Q.R.S.T/32
  138. SSH TCP 22 0.0.0.0/0
  139. Custom Protocol AH (51) All 0.0.0.0/0
  140. Custom Protocol ESP (50) All 0.0.0.0/0
  141. Custom UDP Rule UDP 4500 0.0.0.0/0
  142. Custom UDP Rule UDP 500 0.0.0.0/0
  143. All ICMP - IPv4 All N/A 0.0.0.0/0
  144.  
  145. Type Protocol Port Range Source Description
  146. All traffic All All 0.0.0.0/0
  147. All traffic All All M.N.O.P/32
  148. All traffic All All Q.R.S.T/32
  149.  
  150. Destination Target Status Propagated
  151. E.F.0.0/16 local Active No
  152. 0.0.0.0/0 igw-747d3673hsd Active No
  153. M.N.O.P/32 eni-0fec2be5-on-ec2 Active No
  154. Q.R.S.T/32 eni-0fec2be5-on-ec2 Active No
  155.  
  156. Rule # Type Protocol Port Range Source Allow / Deny
  157. 100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
  158. 200 ALL Traffic ALL ALL M.N.O.P/32 ALLOW
  159. 300 ALL Traffic ALL ALL Q.R.S.T/32 ALLOW
  160. * ALL Traffic ALL ALL 0.0.0.0/0 DENY
  161.  
  162. Rule # Type Protocol Port Range Source Allow / Deny
  163. 100 ALL Traffic ALL ALL 0.0.0.0/0 ALLOW
  164. 200 ALL Traffic ALL ALL M.N.O.P/32 ALLOW
  165. 300 ALL Traffic ALL ALL Q.R.S.T/32 ALLOW
  166. * ALL Traffic ALL ALL 0.0.0.0/0 DENY
Add Comment
Please, Sign In to add comment