【RouterOS】——怎样route traffic to the remote gateway
| 本帖最後由 角色 於 2014-11-17 14:07 編輯 
 两个routerboards (Routerboard A,B)用VPN连起来是非常方便的,但是怎样把PC 插入Routerboard A,然后把PC的traffic 转到Routerboard B的gateway走呢?
 
 应该这样说,因为RB的RouterOS一般都有default configuration file,里面已经有default route 0.0.0.0/0,所以用/interface pptp-client里的default route 0.0.0.0/0没有起作用。所以我们用policy route才能完成。
 
 下面的10.0.81.0/24是我的router的network ID,你们可以改回default network 192.168.88.0/24。
 複製代碼/ppp profile
add name="profile-hk" use-encryption=yes
/interface pptp-client
add name="pptp-hk" connect-to=ip_address_or_hostname user="john" \
password="john-passowrd" profile=profile-hk
/ip firewall mangle
add chain=prerouting action=mark-routing new-routing-mark=through_vpn_hk \
protocol=tcp src-address=10.0.81.0/24
/ip firewall nat
add chain=srcnat action=masquerade src-address=10.0.81.0/24 \
out-interface=pptp-hk 
/ip route
add dst-address=0.0.0.0/0 gateway="pptp-hk" routing-mark=through_vpn_hk
 |