請教Routeros 多PPPOE+IPV6 不同網段轉NAT

大家好,最近買了 MikroTik RB750Gr3 但碰到一些設定上的問題想請教各位大神。

以下是我家希望能設定出來的網路圖
請教Routeros 多PPPOE+IPV6 不同網段轉NAT

文字敘述:
1.希望家裡能分三個網段
192.168.100.0/24 Nas等設備
192.168.50.0/24 有線網路 無DHCP
192.168.200.0/24 Wifi
第一點已設定完成,不同的虛擬IP網段可以走不同的PPPOE路線出去

2.希望 In 跟 Out 走不同IP
OUT IPV4/IPV6:
192.168.100.0/24 PPPOE1(浮動) 
192.168.50.0/24 PPPOE2(浮動)
192.168.200.0/24 Wifi PPPOE3(浮動)

IN
PPPOE-Static (浮動固定制 @ip.hinet.net)
一組固定IP 220.135.5.xxx 針對不同Port NAT到不同網段
80,443 -> 192.168.100.200
3389 -> 192.168.50.1

目前碰到的問題:
1.第二點找了很多資料嘗試設定,始終無法達到 連外跟連入是不同的IP
2.也沒有看到有文件在介紹多PPPOE 指定Route 要如何設定 Hinet Dual Stack

目前已經達成若Nas 跟 Win10 PC 都使用  192.168.100.0/24 Route-> PPPOE-Static
用NAT轉Port 是連的到

但若把Win-10PC放到 192.168.50.1的網段 NAT會轉不過去,因為進來的封包是走 PPPOE-Static 也就是 100網段

不知道上述兩點該如何設定
感謝各位的指教。
2019-10-06 22:16 發佈
mvradio wrote:
大家好,最近買了 MikroTik...(恕刪)

假如不要用PPPOE撥號... 改用切VLAN呢??
小區網...乾脆同網段就好~~
把IP設成同一網段就應該就可以了
改成:192.168.100.0/22(255.255.252.0 遮罩2個255+1個252),
這樣就有
192.168.100.1~192.168.103.254 可以用

192.168.100.0/24 改成 192.168.100.0/22
192.168.50.0/24 改成 192.168.101.0/22
192.168.200.0/24 改成 192.168.102.0/22

ROS LAN IP 改成 192.168.100.1/22(或網段內任何一組IP) ,所有的設備 Gateway都指到192.168.100.1
這樣子多就會好設很多
第二點不可行,來回要同IP是基本規則....

把要讓外部連進來的主機去回都指定NAT對應固定IP
單純對外的才NAT由浮動IP出去
mvradio wrote:
laevatain wrote:

policy route設置好能達成樓主需求,您可能錯過小弟整理吧...
因Rb750g3軟硬體上的限制,有需和樓主說明的:
1.若您申請的網路有達300/100M,因fasttrack(NAT加速,使用MT7621交換器晶片)
不支援policy route,所以只有default route能跑滿(以下範例設置為pppoe-out2),
policy route路由的pppoe-out只能跑至cpu的極限,下載約210M上下。

2.因Mikrotik Router的ipv6暫不支援policy route,
而中華DualStack給浮動制用戶只給予/64網段,並未有固定制用戶/58有
自訂與切割的能力。在您3個區網中,只能指定其一能安裝ipv6

下範例是將ipv6設置到wifi分享器(192.168.200.0/24)內,
而192.168.50.0/24與192.168.100.0/24則因限制,暫無法啟用ipv6功能。

以下是設置,若有問題可以請小弟幫忙:
#註:
1.pppoe-out0是固定ip撥號
2.
ether4 -> 192.168.100.0/24
bridge1(ether2-3) -> 192.168.50.0/24
ether5 -> 192.168.200.0/24

/ip dns
set allow-remote-requests=no servers=8.8.8.8

/interface pppoe-client
add add-default-route=yes interface=ether1 name=pppoe-out0 \
password=pass profile=default user=user@ip.hinet.net
add add-default-route=yes interface=ether1 name=pppoe-out1 \
password=pass profile=default user=user@hinet.net
add add-default-route=yes interface=ether1 name=pppoe-out2 \
password=pass profile=default user=user@hinet.net
add add-default-route=yes interface=ether1 name=pppoe-out3 \
password=pass profile=default user=user@hinet.net

/interface bridge
add fast-forward=yes name=bridge1

/interface bridge port
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
disable [find interface=ether4]
disable [find interface=ether5]

/ip pool
add name=dhcp100 ranges=192.168.100.1-192.168.100.253
add name=dhcp50 ranges=192.168.50.1-192.168.50.253
add name=dhcp200 ranges=192.168.100.1-192.168.100.253

/ip address
add address=192.168.0.1/24 interface=ether1 network=192.168.0.0
add address=192.168.100.254/24 interface=ether4 network=192.168.100.0
add address=192.168.50.254/24 interface=bridge1 network=192.168.50.0
add address=192.168.200.254/24 interface=ether5 network=192.168.200.0

/interface list
add name=Wan
add name=Lan

/interface list member
add interface=ether4 list=Lan
add interface=bridge1 list=Lan
add interface=ether5 list=Lan
add interface=ether1 list=Wan
add interface=pppoe-out0 list=Wan
add interface=pppoe-out1 list=Wan
add interface=pppoe-out2 list=Wan
add interface=pppoe-out3 list=Wan

/ip dhcp-server
add address-pool=dhcp100 disabled=no interface=ether4 name=dhcp100
add address-pool=dhcp50 disabled=no interface=bridge1 name=dhcp50
add address-pool=dhcp200 disabled=no interface=ether5 name=dhcp200

/ip dhcp-server network
add address=192.168.100.0/24 dns-server=8.8.8.8 gateway=192.168.100.254
add address=192.168.50.0/24 dns-server=8.8.8.8 gateway=192.168.50.254
add address=192.168.200.0/24 dns-server=8.8.8.8 gateway=192.168.200.254

/ip firewall mangle
add action=change-mss chain=forward comment=ChangeMSS \
new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn

add action=accept chain=prerouting dst-address=192.168.0.0/16 in-interface-list=Lan
add action=accept chain=prerouting dst-address-type=local in-interface-list=Lan
add action=accept chain=output out-interface-list=Lan

add action=mark-connection chain=prerouting connection-state=new,established \
in-interface=pppoe-out2 new-connection-mark=pppoe2_conn passthrough=yes \
src-address-type=!local
add action=mark-connection chain=prerouting connection-state=new,established \
in-interface=pppoe-out0 new-connection-mark=pppoe0_conn passthrough=yes \
src-address-type=!local
add action=mark-connection chain=prerouting connection-state=new,established \
in-interface=pppoe-out1 new-connection-mark=pppoe1_conn passthrough=yes \
src-address-type=!local
add action=mark-connection chain=prerouting connection-state=new,established \
in-interface=pppoe-out3 new-connection-mark=pppoe3_conn passthrough=yes \
src-address-type=!local

add action=accept chain=prerouting connection-mark=pppoe2_conn \
in-interface-list=Lan
add action=mark-routing chain=prerouting connection-mark=pppoe0_conn \
new-routing-mark=to_pppoe0 passthrough=yes in-interface-list=Lan
add action=mark-routing chain=prerouting connection-mark=pppoe1_conn \
new-routing-mark=to_pppoe1 passthrough=yes in-interface-list=Lan
add action=mark-routing chain=prerouting connection-mark=pppoe3_conn \
new-routing-mark=to_pppoe3 passthrough=yes in-interface-list=Lan

add action=accept chain=output connection-mark=pppoe2_conn
add action=mark-routing chain=output connection-mark=pppoe0_conn \
new-routing-mark=to_pppoe0 passthrough=yes
add action=mark-routing chain=output connection-mark=pppoe1_conn \
new-routing-mark=to_pppoe1 passthrough=yes
add action=mark-routing chain=output connection-mark=pppoe3_conn \
new-routing-mark=to_pppoe3 passthrough=yes

add action=mark-routing chain=prerouting new-routing-mark=to_pppoe1 \
passthrough=yes in-interface=ether4
add action=mark-routing chain=prerouting new-routing-mark=to_pppoe3 \
passthrough=yes in-interface=ether5

/ip route
add dst-address=0.0.0.0/0 gateway=pppoe-out0 distance=4 routing-mark=to_pppoe0
add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=4 routing-mark=to_pppoe1
add dst-address=0.0.0.0/0 gateway=pppoe-out3 distance=4 routing-mark=to_pppoe3
add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=5

/ip firewall nat
add chain=srcnat out-interface-list=Wan action=masquerade

add chain=srcnat src-address=192.168.0.0/16 dst-address=192.168.100.200 \
action=masquerade
add chain=srcnat src-address=192.168.0.0/16 dst-address=192.168.50.1 \
action=masquerade

add chain=dstnat dst-address=220.135.5.xxx protocol=tcp dst-port=80,443 \
to-addresses=192.168.100.200 action=dst-nat
add chain=dstnat dst-address=220.135.5.xxx protocol=tcp dst-port=3389 \
to-addresses=192.168.50.1 action=dst-nat

/ip firewall filter
#需置頂至視窗最上方優先運行
add action=fasttrack-connection chain=forward comment=fasttrack \
connection-state=established,related in-interface=pppoe-out2

/ipv6 dhcp-client
add add-default-route=yes interface=pppoe-out0 pool-name=DualStack \
rapid-commit=no request=prefix use-peer-dns=no

/ipv6 address
add address=::1 from-pool=DualStack interface=ether5

/ipv6 nd
set [ find default=yes ] interface=ether5

/ipv6 firewall mangle
add action=change-mss chain=forward comment=ChangeMSS \
new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn
感謝各位的回覆
這周只有三個工作天 都比較晚下班
今天才回復請各位見諒

小笨賢 wrote:
假如不要用PPPOE...(恕刪)

我想要不同網段走不同PPPOE是因為家裡人有時候喜歡下載東西
若走同一個IP 很容易被免空限速
有些網站又喜歡檢舉別人同IP是共用帳號~

chuway wrote:
把IP設成同一網段就...(恕刪)

這個我有想過欸
現在的工作是做資安所以想自己在家試試看這樣的網路架構


laevatain wrote:第二點不可行,來回要...(恕刪)
這個架構我在前一份工作學校電算中心任職,那時候看過類似的架構
但我做資安對網路不熟 那時候用UTM-3500

當時學校有4條中華電信固定IP (100/100) 一條教育部IP (Tanet 區網)
所有行政跟學術單位對外 都是用Load Balance 4條去跳,伺服器也一樣
但這有個缺點,若下載比較大的檔案 超過1GB 有可能防火牆就跳第二條導致下載中斷
所以比較賊的方式是 我們那時候可以針對 特定網段去Group 誰跳 1 2 誰跳 3 4 

電算中心 就設了一個 Group 只有1 那就不會亂跳能下載Iso檔案

gfx wrote:
policy route...(恕刪)

感謝大大的神回復,其實在這裡很多資料都散在文章回復
若有漏看敬請見諒!
我網路知識比較薄弱還在學習中,我看了很久您的指令想請教一個問題
其實Switch後面還有很多同網段設備,我當初想 我能設定一台 其他二三台我應該也會設定

圖漏寫ether的部分

ether1 -Wan ->中華電信
ether2- 到Switch 50網段
ether3 100
ether4 200

為什麼Bridge 只套 50的?
謝謝
mvradio wrote:
我不知道您ethernet的配置,就假設ether2-3都是50。
兩個以上的ethernet橋接,就需要經bridge橋接這步驟。

既然
ether1 -Wan ->中華電信
ether2- 到Switch 50網段
ether3 100
ether4 200

那您大可省略bridge1橋接這個步驟。
另外我也猜50是三個Lan最吃重的,因50是採pppoe-out2,
所以pppoe-out2被我指定成default route,也是唯一有nat加速的pppoe撥號。
mvradio wrote:
感謝各位的回覆這周只...(恕刪)

Port 80 443 走 DDNS (台灣的免費 dns)
其他的走 固定ip
搞的太複雜,效能會低落

網卡橋接方式會忽快忽慢,路由器我就不知道了
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?