我想互连两个办公室,一个公共静态 IP地址(主办公室),另一个办公室后面是NAT (无公共IP),因为只有一个LTE调制解调器。
我能够创build一个从LTE调制解调器到主要办公室的单向VPN连接,但是有可能使两个办公室之间的TCP双向通信成为可能吗? 那么从总部的人可以例如RDP到分支机构?
(我正在使用两个MikroTik路由器板和一个PPTP连接,如果需要的话,我应该可以更改为L2TP)。
更新:
我正在提供详细的要求:
总部:局域网:192.168.16.0/24
公共IP:MAIN_OFFICE_IP
分局局域网:192.168.1.0/24
公共IP:[来自ISP的DHCP]
BRANCH OFFICEconfiguration:
两个networking接口
一个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”
在主办公室路由器上,添加一个本地地址为192.168.2.1和远程地址为192.168.2.2的PPP密码。
在分支路由器上,创build你的PPTP客户端到主办公室(就像你一样),它应该得到正确的IP(192.168.2.2)。
那么你只需要添加2个路线:
在主路由器上:通过192.168.2.2路由192.168.1.0/24
在分支路由器上:通过192.168.2.1路由192.168.16.0/24
不需要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.1