FreeS/WAN에서 핑이 안됩니다.
글쓴이: ejungw / 작성시간: 금, 2003/07/18 - 10:27오후
안녕하세요? 와우리눅스7.1(커널2.4.2)에서 FreeS/WAN 1.99를 설치하고 있습니다.
subnet ----- left gateway === right gateway ----- subnet 192.168.2.0 X.X.X.117 X.X.X.151 192.168.1.0
로 구성이 되어있구요. 각 서브넷에는 윈2000이깔린 컴이 한대씩 물려있습니다.
ipsec whack --status 를 한 결과는 다음과 같습니다.
000 interface ipsec0/eth0 X.X.X.151 000 000 "myfreeswan": 192.168.1.0/24===X.X.X.151...X.X.X.117===192.168.2.0/24 000 "myfreeswan": ike_life: 3600s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0 000 "myfreeswan": policy: RSASIG+ENCRYPT+AUTHENTICATE+COMPRESS+TUNNEL+PFS; interface: eth0; erouted 000 "myfreeswan": newest ISAKMP SA: #1; newest IPsec SA: #4; eroute owner: #4 000 000 #4: "myfreeswan" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 25675s; newest IPSEC; eroute owner 000 #4: "myfreeswan" ah.2d658a36@X.X.X.117 ah.cf65afea@X.X.X.151 esp.2d658a37@X.X.X.117 esp.cf65afeb@X.X.X.151 comp.8001@X.X.X.117 comp.90cb@X.X.X.151 tun.1004@X.X.X.117 tun.1003@X.X.X.151 000 #1: "myfreeswan" STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 448s; newest ISAKMP 000 #3: "myfreeswan" STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 26349s 000 #3: "myfreeswan" ah.2d658a34@X.X.X.117 ah.cf65afe8@X.X.X.151 esp.2d658a35@X.X.X.117 esp.cf65afe9@X.X.X.151 comp.8000@X.X.X.117 comp.90ca@X.X.X.151 tun.1002@X.X.X.117 tun.1001@X.X.X.151 000 #2: "myfreeswan" STATE_MAIN_R3 (sent MR3, ISAKMP SA established); EVENT_SA_REPLACE in 1149s 000
X.X.X.151(right gateway)에서 route를 한 결과는 다음과 같습니다
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 X.X.X.117 255.255.255.0 UG 0 0 0 ipsec0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 X.X.X.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 X.X.X.0 0.0.0.0 255.255.255.0 U 0 0 0 ipsec0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 X.X.X.1 0.0.0.0 UG 0 0 0 eth0
ipsec.conf라는 설정파일은 다음과 같습니다.
# /etc/ipsec.conf - FreeS/WAN IPsec configuration file # More elaborate and more varied sample configurations can be found # in FreeS/WAN's doc/examples file, and in the HTML documentation. # basic configuration config setup # THIS SETTING MUST BE CORRECT or almost nothing will work; # %defaultroute is okay for most simple cases. interfaces=%defaultroute # Debug-logging controls: "none" for (almost) none, "all" for lots. klipsdebug=none plutodebug=none # Use auto= parameters in conn descriptions to control startup actions. plutoload=%search plutostart=%search # Close down old connection when new one using same ID shows up. uniqueids=yes # defaults for subsequent connection descriptions # (these defaults will soon go away) conn %default keyingtries=0 disablearrivalcheck=no authby=rsasig leftrsasigkey=%dnsondemand rightrsasigkey=%dnsondemand # connection description for opportunistic encryption # (requires KEY record in your DNS reverse map; see doc/opportunism.howto) conn myfreeswan left=X.X.X.117 leftsubnet=192.168.2.0/24 ###leftfirewall=yes #leftnexthop=X.X.X.151 right=X.X.X.151 rightsubnet=192.168.1.0/24 ###rightfirewall=yes #rightnexthop=X.X.X.117 keyingtries=0 auth=ah authby=rsasig leftrsasigkey=0sAQOmLHNSsbrKRt9nhhyWxBMZORwaHknkaXUrs8w2RzKBiCMTCQbfc3emZnBDBs2fOdjN6X3TLlQ1S2iw5D/EC5xs0uVN6k3FP9uibQfBCkmbL0/r+/Rg1jyMU0THFKoCLTnBpSI8U38VE/ButiVD3EneqWJ82qKSFQRzhQ/s9EiPBQ== rightrsasigkey=0sAQPQeiC87Ar/pXIqkk6UzrlTcYtTcgclI1VLJUA/rqF/YTZIxrtj7n0C/WoHxKnPXGvyBcizo2CCVe4OJl5w7fjRDofuOpGFWcnhBTH/UMrO7nyQzaUssBq/iRDrBP3IIZaMxYbROrSr7LSeBWyhxyWba0QPNS8gB/EubMrdLwnu9w== auto=start compress=yes conn me-to-anyone left=%defaultroute right=%opportunistic keylife=1h rekey=no # for initiator only OE, uncomment and uncomment this # after putting your key in your forward map #leftid=@myhostname.example.com # uncomment this next line to enable it #auto=route # sample VPN connection conn sample # Left security gateway, subnet behind it, next hop toward right. left=10.0.0.1 leftsubnet=172.16.0.0/24 leftnexthop=10.22.33.44 # Right security gateway, subnet behind it, next hop toward left. right=10.12.12.1 rightsubnet=192.168.0.0/24 rightnexthop=10.101.102.103 # To authorize this connection, but not actually start it, at startup, # uncomment this. #auto=add
왼쪽서브넷에 있는 컴퓨터에서 오른쪽 서브넷에 있는 컴퓨터로 핑이 가야 한다고 (또는 그 반대방향) 매뉴얼에는 적혀 있는데 계속 request timed out이 나옵니다.
라우팅경로나 iptables문제 같기도 한데.. 잘 안됩니다. 현재는 각 게이트웨이에서 iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to X.X.X.151 이런식으로 마스커레이딩을 하여 서브넷에 있는 컴이 인터넷을 하고 있습니다.
(iptables로 다른 부분은 막지 않았습니다.)
도움을 부탁드립니다.
그럼 좋은 하루 되십시오.
Forums:
저는 이부분에 대해서는 잘 모르지만 한가지만 짚어볼까합니다. ip
저는 이부분에 대해서는 잘 모르지만 한가지만 짚어볼까합니다.
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to X.X.X.151 라는 부분이 문제가 되는것 같군요
이렇게 쓰면 당연히 X.X.X.151로 보내는게 아닐까 생각되네요.
제생각으로는 아래와 같이 사용하는게 맞지 않을까 생각되네요
iptables -t nat –F
iptables -t nat -A POSTROUTING -o eth0 -d \! 10.0.0.0/8 -j MASQUERADE
이렇게 iptables코드를 사용하는데 맞지 않을가 생각되네요...
댓글 달기