[SOLVED] 2 concurent pppoe connections on the same wan interface
Posted: Sun Nov 06, 2016 7:02 pm
Hi,
I am new here and this is my first post so please be patient with me. I have a situation in whitch my client ISP has alocated him 2 pppoe conections ( 2 different username and passwords) on the single FTP cable. Now it is working as ISP cable is into a 5 port switch from where leave 2 ftp cables into two distinct wi-fi routers in order to make concurent connections in the same time.
I was wondering if it could be possible to do that with one mikrotik equipment, let's say hEX-RB750Gr2 or RB951G-2HnD with latest firmware 6.37.1 ( before i recommend them to my client i just want to be sure that it is works), like image below:

I have searched the forum and google and came up with a basic configuration for that, if would be plausible:
# setting up bridges and populate them with proper ports
# alocate ip addresses to bridges
# creating pools for two Lans
# creating dhcp servers for both lans and alocate them proper pool
# change default services
# create pppoe connections
# i have left out/unchecked "add default route" since i am interesting in manually manipulate
# the routing table, routing lan1 to pppoe1 and lan2 to pppoe2
# As for "dial on demand" i am not sure if i have to let it check or uncheck; for now i will
# leave it checked to see what is happened
# filter rules
# mangle rules
# marking packets for 2 lans
# nat both networks
# manual routing two connections / pppoe{1,2} for lan1/2
Is there anyone kind enough to guide me if such a scenario is possible ? If it is, are ok my lines of config ?
Thank you very much for your patience; kind regards.
I am new here and this is my first post so please be patient with me. I have a situation in whitch my client ISP has alocated him 2 pppoe conections ( 2 different username and passwords) on the single FTP cable. Now it is working as ISP cable is into a 5 port switch from where leave 2 ftp cables into two distinct wi-fi routers in order to make concurent connections in the same time.
I was wondering if it could be possible to do that with one mikrotik equipment, let's say hEX-RB750Gr2 or RB951G-2HnD with latest firmware 6.37.1 ( before i recommend them to my client i just want to be sure that it is works), like image below:

I have searched the forum and google and came up with a basic configuration for that, if would be plausible:
# setting up bridges and populate them with proper ports
Code: Select all
/interface bridge
add comment="Bridge ports 2-3 to LAN1" name=bridge1-LAN1
add comment="Bridge ports 4-5 to LAN2" name=bridge2-LAN2
/interface ethernet
set [ find default-name=ether1 ] comment="WAN ISP"
set [ find default-name=ether2 ] comment="Bridge ports 2-3 to LAN1"
set [ find default-name=ether4 ] comment="Bridge ports 4-5 to LAN2"
/interface bridge port
add bridge=bridge1-LAN1 interface=ether2
add bridge=bridge1-LAN1 interface=ether3
add bridge=bridge2-LAN2 interface=ether4
add bridge=bridge2-LAN2 interface=ether5
Code: Select all
/ip address
add address=172.16.1.254/24 interface=bridge1-LAN1 network=172.16.1.0
add address=172.16.2.254/24 interface=bridge2-LAN2 network=172.16.2.0
Code: Select all
/ip pool
add name=pool-lan1 ranges=172.16.1.50-172.16.1.100
add name=pool-lan2 ranges=172.16.2.50-172.16.2.100
Code: Select all
/ip dhcp-server
add address-pool=pool-lan1 disabled=no interface=bridge1-LAN1 lease-time=1d name=dchp-lan1
add address-pool=pool-lan2 disabled=no interface=bridge2-LAN2 lease-time=1d name=dchp-lan2
/ip dhcp-server network
add address=172.16.1.0/24 dns-server=8.8.8.8 gateway=172.16.1.254
add address=172.16.2.0/24 dns-server=8.8.8.8 gateway=172.16.2.254
Code: Select all
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www port=9999
set ssh disabled=yes
set winbox port=8299
# i have left out/unchecked "add default route" since i am interesting in manually manipulate
# the routing table, routing lan1 to pppoe1 and lan2 to pppoe2
# As for "dial on demand" i am not sure if i have to let it check or uncheck; for now i will
# leave it checked to see what is happened
Code: Select all
/interface pppoe-client
add add-default-route=no allow=pap,chap,mschap2 comment="PPPOE1 on WAN" dial-on-demand=yes \
disabled=no interface=ether1 max-mru=1480 max-mtu=1480 mrru=1600 name= \
pppoe-out1 password=xxxxx use-peer-dns=yes user=yyyyy
add add-default-route=no allow=pap,chap,mschap2 comment="PPPOE2 on WAN" dial-on-demand=yes \
disabled=no interface=ether1 max-mru=1480 max-mtu=1480 mrru=1600 name= \
pppoe-out2 password=zzzzz use-peer-dns=yes user=wwwww
Code: Select all
/ ip firewall filter
add action=accept chain=input comment="Accept winbox conectivity on 8299 port - pppoe1" dst-port=8299 \
in-interface=pppoe-out1 log=yes protocol=tcp
add action=accept chain=input comment="Accept winbox conectivity on 8299 port - pppoe2" dst-port=8299 \
in-interface=pppoe-out2 log=yes protocol=tcp
add action=accept chain=input comment="Web access on 9999 port - pppoe-out1" dst-port=9999 \
in-interface=pppoe-out1 log=yes protocol=tcp
add action=accept chain=input comment="Web access on 9999 port - pppoe-out2" dst-port=9999 \
in-interface=pppoe-out2 log=yes protocol=tcp
add chain=input connection-state=established \
comment="Accept established connections"
add chain=input connection-state=related \
comment="Accept related connections"
add chain=input connection-state=invalid action=drop \
comment="Drop invalid connections"
add chain=input protocol=udp action=accept \
comment="UDP" disabled=no
add chain=input action=log log-prefix="Drop input" \
comment="Log everything else"
add chain=input action=drop \
comment="Drop everything else"
# marking packets for 2 lans
Code: Select all
/ip firewall mangle
add action=mark-packet chain=prerouting comment="Mark packets for LAN1" new-packet-mark=lan1 passthrough=yes src-address=172.16.1.0/24
add action=mark-packet chain=prerouting comment="Mark packets for LAN2" new-packet-mark=lan2 passthrough=yes src-address=172.16.2.0/24
add action=mark-routing chain=prerouting comment="Send packets to right routing table - LAN1" new-routing-mark=lan1 packet-mark=lan1 passthrough=no
add action=mark-routing chain=prerouting comment="Send packets to right routing table - LAN2" new-routing-mark=lan2 packet-mark=lan2 passthrough=no
Code: Select all
/ip firewall nat
add action=masquerade chain=srcnat comment="NAT LAN1" out-interface=pppoe-out1 src-address=172.16.1.0/24
add action=masquerade chain=srcnat comment="NAT LAN2" out-interface=pppoe-out2 src-address=172.16.2.0/24
Code: Select all
/ip route
add check-gateway=ping disabled=no distance=1 gateway=pppoe-out1 routing-mark=lan1
add check-gateway=ping disabled=no distance=1 gateway=pppoe-out2 routing-mark=lan2
Thank you very much for your patience; kind regards.