我想连接两个办公室,其中一个有一个公共静态IP地址(主办公室),第二个在NAT (没有公共IP)后面,因为只有一个LTE调制解调器。
我能够创建一个从LTE调制解调器到主办公室的单向VPN连接,但是是否可以使两个办事处之间的TCP通信是双向的?这样,人们就可以从主办公室比如RDP到分公司吗?
(我使用两个MikroTik路由器和一个PPTP连接。如果需要,我应该能够更改为L2TP。)。
我根据要求提供详细资料:
总办公室: LAN: 192.168.16.0/24
公共IP: MAIN_OFFICE_IP
办事处局域网: 192.168.1.0/24
公共IP:来自ISP的DHCP
两个网络接口
一个PPTP客户端
绝对基本防火墙和NAT
/interface ethernet
set [ find default-name=ether1 ] name=ether1-gateway
set [ find default-name=ether2 ] arp=proxy-arp name=ether2-master-local
/interface pptp-client
add add-default-route=yes allow=pap,chap,mschap1,mschap2 connect-to=MAIN_OFFICE_IP default-route-distance=1 dial-on-demand=no disabled=no keepalive-timeout=60 max-mru=1450 max-mtu=1450 mrru=1600 name=\
MAIN_OFFICE_VPN password=******** profile=default-encryption user=MAIN_OFFICE_USER
/ip firewall filter
add chain=input comment="default configuration" protocol=icmp
add chain=input comment="default configuration" connection-state=established
add chain=input comment="default configuration" connection-state=related
add action=drop chain=input comment="default configuration" in-interface=ether1-gateway
add chain=forward comment="default configuration" connection-state=established
add chain=forward comment="default configuration" connection-state=related
add action=drop chain=forward comment="default configuration" connection-state=invalid
/ip firewall nat
add action=masquerade chain=srcnat comment="default configuration" out-interface=ether1-gateway to-addresses=0.0.0.0
add action=masquerade chain=srcnat out-interface=MAIN_OFFICE_VPN
add action=dst-nat chain=dstnat dst-address=BRANCH_IP dst-port=100 protocol=tcp
/ip route
add distance=1 dst-address=192.168.16.0/24 gateway=OFFICE_VPN routing-mark=“MAIN_OFFICE_VPN”发布于 2016-05-27 06:59:32
在主办公室路由器上,添加具有本地地址192.168.2.1和远程地址192.168.2.2的PPP秘密。
在分支路由器上,将PPTP客户端创建到主办事处(就像您所做的那样),它应该得到正确的IP (192.168.2.2)。
然后你只需要增加两条路线:
主路由器:路由192.168.1.0/24,通过192.168.2.2
在分支路由器上:路由192.168.16.0/24通过192.168.2.1
不需要NAT或特定的防火墙/故障规则。
这给出了Mikrotik语言:
Main router:
/ppp secret
add name=branch password=foobar profile=default-encryption remote-address=192.168.2.2 local-address=192.168.2.1 service=pptp
/ip route
add dst-address=192.168.1.0/24 gateway=192.168.2.2
Branch Router
/interface pptp-client
add connect-to=OFFICE_IP disabled=no name=pptp-office password=\
foobar profile=default-encryption user=branch
/ip route
add dst-address=192.168.16.0/24 gateway=192.168.2.1https://serverfault.com/questions/779287
复制相似问题