|
发表于 2017-3-31 01:29:28
|
显示全部楼层
本帖最后由 cspm333 于 2017-3-31 10:47 编辑
假設RouterB (192.168.2.0/24) 透過pptp與RouterA (192.168.1.0/24)連線,
所以RouterB的pptp接口為pptp-out1 ,RouterA的pptp接口為pptp-in1
若RouterB的192.168.2.7 要透過RouterA的wan進行映射,
首要讓RouterA與RouterB兩個內網透過pptp互連.
RouterA新增: /ip router add dst-address=192.168.2.0/24 gateway=pptp-in1 distance=1
RouterB新增: /ip router add dst-address=192.168.1.0/24 gateway=pptp-out1 distance=1
RouterA新增nat映射,將udp dst-port:6881 映射給192.168.2.7
/ip firewall nat add action=dst-nat protocol=udp dst-port=6881 to-addresses=192.168.2.7 in-interface=pppoe-out1
RouterB路由表新增routing-mark:
/ip route add gateway=pptp-client1 routing-mark=fromRA distance=2
RouterB新增來自RouterA的標記策略:
/ip firewall mangle add action=mark-connection chain=prerouting in-interface=pptp-client1 new-connection-mark=pptp_conn passthrough=yes
/ip firewall mangle add action=mark-routing chain=prerouting src-address=192.168.2.7 connection-mark=pptp_conn new-routing-mark=fromRA passthrough=no
遠端連線從RouterA 映射到RouterB 192.168.2.7的封包,走的是pptp
當192.168.2.7回應完,也必須走原來的pptp的路徑先經RouterA,再回給internet的另一端.
|
|