拓扑
192.168.10.x---1.1.1.1-----internet------2.2.2.2-----10.2.1.x
两个路由建立了ipsec隧道,显示remote peer也都连上了,就是ping不通。
NAT的accept也加上了。
谁能帮我看看那里还有问题。谢谢。
Route1
[admin@R_Shanghai] > ip ipsec peer print
Flags: X - disabled, D - dynamic
0 address=1.1.1.1/32 local-address=0.0.0.0 passive=no port=500
auth-method=pre-shared-key secret="***" generate-policy=no
policy-template-group=default exchange-mode=main send-initial-contact=yes
nat-traversal=yes proposal-check=obey hash-algorithm=sha1 enc-algorithm=3des
dh-group=modp1024 lifetime=1d lifebytes=0 dpd-interval=2m dpd-maximum-failures=5
[admin@R_Shanghai] > ip ipsec policy print
Flags: T - template, X - disabled, D - dynamic, I - inactive, * - default
0 T * group=default src-address=::/0 dst-address=::/0 protocol=all proposal=default
template=yes
1 src-address=10.2.1.0/24 src-port=any dst-address=192.168.10.0/24 dst-port=any
protocol=all action=encrypt level=require ipsec-protocols=esp tunnel=yes
sa-src-address=2.2.2.2 sa-dst-address=1.1.1.1 proposal=default
priority=0
[admin@R_Shanghai] > ip ipsec remote-peers print
0 local-address=2.2.2.2 remote-address=1.1.1.1 state=established
side=responder established=49m11s
[admin@R_Shanghai] > ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=srcnat action=accept src-address=192.168.10.0/24 dst-address=10.2.1.0/24
log=no log-prefix=""
[admin@R_Shanghai] > ping 192.168.10.1 src-address=10.2.1.1
SEQ HOST SIZE TTL TIME STATUS
0 192.168.10.1 timeout
1 192.168.10.1 timeout
2 192.168.10.1 timeout
sent=3 received=0 packet-loss=100%
Route2
[admin@R_Beijing] > ip ipsec peer print
Flags: X - disabled, D - dynamic
0 address=2.2.2.2/32 local-address=0.0.0.0 passive=no port=500
auth-method=pre-shared-key secret="***" generate-policy=no
policy-template-group=default exchange-mode=main send-initial-contact=yes
nat-traversal=yes proposal-check=obey hash-algorithm=sha1
enc-algorithm=3des,aes-128 dh-group=modp1024 lifetime=1d lifebytes=0
dpd-interval=2m dpd-maximum-failures=5
[admin@R_Beijing] > ip ipsec policy print
Flags: T - template, X - disabled, D - dynamic, I - inactive, * - default
0 T * group=default src-address=::/0 dst-address=::/0 protocol=all proposal=default
template=yes
1 src-address=192.168.10.0/24 src-port=any dst-address=10.2.1.0/24 dst-port=any
protocol=all action=encrypt level=require ipsec-protocols=esp tunnel=yes
sa-src-address=1.1.1.1 sa-dst-address=2.2.2.2 proposal=default
priority=0
[admin@R_Beijing] > ip ipsec remote-peers print
0 local-address=1.1.1.1 remote-address=2.2.2.2 state=established
side=responder established=54m23s
[admin@R_Beijing] > ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=srcnat action=accept src-address=10.2.1.0/24 dst-address=192.168.10.0/24
log=no log-prefix=""
1 X chain=srcnat action=masquerade log=no log-prefix=""
[admin@R_Beijing] > ping 10.2.1.1 src-address=192.168.10.1
SEQ HOST SIZE TTL TIME STATUS
0 10.2.1.1 timeout
1 10.2.1.1 timeout
2 10.2.1.1 timeout
sent=3 received=0 packet-loss=100%
1
linchanx 2015-03-11 10:16:18 +08:00 1
你的对接地址都不在同一个网段 怎么通? 一边是1.1.1.1 另外一边是2.2.2.2 。还用的32位。
|
2
bellchu 2015-03-11 10:51:13 +08:00 1
看src-address和dst-address都是内网地址,应该是nat做错了
另外需要指定路由192.168.10.0/24的走2.2.2.2的Interface,10.2.1.0/24的走1.1.1.1的Interface才可以用ping 10.2.1.1 src-address=192.168.10.1和 ping 192.168.10.1 src-address=10.2.1.1的命令ping,不然路由器不知道如何选路,因为路由表内没有相应记录 PS:mikrotik routeros的设备我没配过(应该是吧?) |
3
willamtang OP @linchanx 真实对接地址是两个公网地址,我改成示例地址了。
|
4
willamtang OP @bellchu 呃,nat的action用的accept不应该两边都是内网地址么?
直接路由制定2.2.2.2的话好像不能激活路由记录。制定wan口的时候可以激活但是却不通。 |
5
bellchu 2015-03-11 12:06:50 +08:00 1
@willamtang nat默认不就是accept么?不要和firewall的action混淆起来。虽然我对mikrotik不了解,只看过它的文档和几个视频。但是nat不就是inside和outside的一个translation么,不可能是两个不同网段的inside interface互相translate的,不然的话这既不是source nat又不是destination nat
你如果目的只是要两边lan互通的话,把nat去掉,直接写路由就OK了。 |
6
invite 2015-03-11 14:41:22 +08:00
这型号路由器没见过。
|
7
willamtang OP @bellchu 现在加的nat rule 不是给ipsec的tunnel用么?
|
8
WuDao 2015-03-12 14:09:28 +08:00 1
不懂路过,纯帮顶……
|
9
willamtang OP 问题解决了,配置本身没啥问题,问题在中间的防火墙没有打开500端口。。。
|