Community discussions

MikroTik App
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

[solved] Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Sat Mar 23, 2024 12:23 pm

7.14.1 on RB4011iGS+ r2 (not complicated setup)
# 2024-03-23 10:05:45 by RouterOS 7.14.1
# software id = 5WSQ-IVBW
#
# model = RB4011iGS+
# serial number = 
/interface bridge
add arp=proxy-arp ingress-filtering=no name=bridge port-cost-mode=short \
    vlan-filtering=yes
/interface ethernet
set [ find default-name=ether10 ] poe-out=off
set [ find default-name=sfp-sfpplus1 ] name=sfp1
/interface l2tp-server
add name=L2TP-VPN user=
/interface vlan
add interface=bridge mtu=1480 name=vlan21 vlan-id=21
add interface=bridge name=vlan50 vlan-id=50
add interface=bridge name=vlan99 vlan-id=99
add interface=bridge name=vlan100 vlan-id=100
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 keepalive-timeout=60 \
    max-mtu=1480 name=pppoe-out1 user=
/interface list
add exclude=dynamic name=discover
add name=mactel
add name=mac-winbox
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=192.168.88.5-192.168.88.148
add name=dhcp-pool99 ranges=192.168.99.2-192.168.99.22
add name=dhcp-pool100 ranges=192.168.100.2-192.168.100.10
add name=L2TP ranges=192.168.88.150-192.168.88.160
add name=dhcp-pool21 ranges=192.168.21.2-192.168.21.6
/ip dhcp-server
add address-pool=dhcp-pool99 authoritative=after-2sec-delay interface=\
    vlan99 lease-time=1d name=dhcp-vlan99
add address-pool=dhcp-pool100 interface=vlan100 lease-time=1w3d name=\
    dhcp-vlan100
add address-pool=dhcp-pool21 authoritative=after-2sec-delay bootp-support=\
    none interface=vlan21 name=dhcp-vlan21
/ip smb users
set [ find default=yes ] disabled=yes
/interface bridge port
add bridge=bridge disabled=yes interface=\
    ether1 internal-path-cost=10 path-cost=10
add bridge=bridge interface=ether2 internal-path-cost=10 \
    path-cost=10
add bridge=bridge interface=sfp1 internal-path-cost=10 path-cost=10
add bridge=bridge interface=ether3 internal-path-cost=10 \
    path-cost=10 pvid=100
add bridge=bridge interface=ether4 \
    internal-path-cost=10 path-cost=10
add bridge=bridge  interface=ether9 \
    internal-path-cost=10 path-cost=10
add bridge=bridge interface=ether5 internal-path-cost=10 path-cost=10
add bridge=bridge interface=ether6 internal-path-cost=10 path-cost=10
add bridge=bridge interface=ether7 internal-path-cost=10 path-cost=10
add bridge=bridge interface=ether8 internal-path-cost=10 path-cost=10
/ip firewall connection tracking
set loose-tcp-tracking=no tcp-established-timeout=30m
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip settings
set max-neighbor-entries=4096 rp-filter=loose
/interface bridge vlan
add bridge=bridge vlan-ids=1
add bridge=bridge tagged=ether2,sfp1,bridge vlan-ids=99
add bridge=bridge tagged=ether2,sfp1,bridge vlan-ids=100
add bridge=bridge tagged=bridge,ether2,sfp1 vlan-ids=50
/interface l2tp-server server
set authentication=mschap2 enabled=yes use-ipsec=yes
/interface list member
add interface=pppoe-out1 list=WAN
add interface=bridge list=LAN
/ip address
add address=192.168.88.1/24 interface=bridge network=192.168.88.0
add address=192.168.99.1/24 interface=vlan99 network=192.168.99.0
add address=192.168.100.1/24 interface=vlan100 network=192.168.100.0
add address=192.168.21.1/29 interface=vlan21 network=192.168.21.0
/ip dhcp-client
add disabled=yes interface=ether1
add comment=defconf disabled=yes interface=ether1
/ip firewall address-list
add address=192.168.88.0/24 list=internal
add address=xx.yyy.zz.aaa list=Whitelist
add address=198.199.104.26 list=banned
add address=118.123.105.90 list=banned
/ip firewall filter
add action=log chain=- comment=\
    ----------------------input--------------------------------
add action=drop chain=input comment="Drop VPN attempts" src-address-list=\
    banned
add action=accept chain=input comment=\
    "defconf: accept established,related,untracked" connection-state=\
    established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
    invalid
add action=accept chain=input comment="Allow L2TP VPN" in-interface=\
    pppoe-out1 log=yes log-prefix=--vpn-in-1st-- port=500,1701,4500 protocol=\
    udp
add action=accept chain=input comment="Allow IPsec ESP" in-interface=\
    pppoe-out1 log=yes log-prefix=--vpn-in-esp-- protocol=ipsec-esp
add action=accept chain=input comment=\
    "Remote access to SSL Mikrotik webif & WinBox" dst-port=443,8291 log=yes \
    protocol=tcp src-address-list=Whitelist
add action=accept chain=input comment=\
    "VPN access to SSL Mikrotik webif & WinBox" dst-port=443,8291 log=yes \
    log-prefix=--VPN-remote-access-- protocol=tcp src-address=192.168.88.161
add action=accept chain=input comment="defconf: accept ICMP (internal)" \
    disabled=yes protocol=icmp src-address-list=internal
add action=accept chain=input comment="Local access to SSH" disabled=yes \
    dst-port=22 protocol=tcp src-address=192.168.88.98
add action=accept chain=input comment="Requests to Mikrotik DNS server (LAN)" \
    disabled=yes dst-port=53 in-interface-list=LAN log=yes log-prefix=--DNS-- \
    protocol=udp
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
    in-interface-list=!LAN log-prefix="--not lan--"
add action=log chain=- comment=\
    -----------------------forward-------------------------------
add action=accept chain=forward log=yes log-prefix=--Yealink-- src-address=\
    192.168.21.2
# L2TP-VPN not ready
add action=accept chain=forward comment="VPN to LAN" in-interface=L2TP-VPN \
    log=yes log-prefix=--vpn-to-lan-- out-interface=bridge
# L2TP-VPN not ready
add action=accept chain=forward comment="LAN to VPN" in-interface=bridge log=\
    yes log-prefix=--lan-to-vpn-- out-interface=L2TP-VPN
# L2TP-VPN not ready
add action=accept chain=forward comment="VPN to Internet" in-interface=\
    L2TP-VPN log=yes log-prefix=--vpn-out-- out-interface=pppoe-out1
# L2TP-VPN not ready
add action=accept chain=forward comment="Internet to VPN" in-interface=\
    pppoe-out1 log=yes log-prefix=--vpn-in-- out-interface=L2TP-VPN
add action=log chain=- comment=\
    ------------------------------------------------------
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
    connection-state=established,related hw-offload=yes
add action=log chain=- comment=\
    ------------------------------------------------------
add action=accept chain=forward comment=\
    "defconf: accept established,related, untracked" connection-state=\
    established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
    connection-state=invalid
add action=drop chain=forward comment=\
    "defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
    connection-state=new in-interface-list=WAN log=yes log-prefix=\
    "--WAN drop--"
add action=drop chain=forward comment=\
    "Disable Guest VLAN to anywhere but Internet" in-interface=\
    vlan99 out-interface=!pppoe-out1
add action=drop chain=forward comment="Drop all other" disabled=yes \
    log-prefix="--Drop all other--" out-interface=pppoe-out1
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
    out-interface=pppoe-out1 out-interface-list=WAN
add action=dst-nat chain=dstnat comment="VNC" dst-port=5900 log=yes \
    protocol=tcp src-address-list=Whitelist to-addresses=192.168.88.25 \
    to-ports=5900
add action=dst-nat chain=dstnat comment="Z web" dst-port=9001 protocol=\
    tcp src-address-list=Whitelist to-addresses=192.168.88.11 to-ports=80
add action=dst-nat chain=dstnat comment="Z stream" dst-port=8082 \
    protocol=tcp src-address-list=Whitelist to-addresses=192.168.88.11 \
    to-ports=8001
add action=dst-nat chain=dstnat comment="VM Minecraft Server" dst-port=\
    27165 log=yes log-prefix=--mc- protocol=tcp to-addresses=192.168.88.50 \
    to-ports=25565
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set sip disabled=yes
set pptp disabled=yes
/ip route
add disabled=no distance=1 dst-address=192.168.2.10/32 gateway=ether1 \
    pref-src="" routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set www-ssl certificate=sc_WC disabled=no tls-version=only-1.2
set api disabled=yes
set api-ssl disabled=yes
/ip smb shares
set [ find default=yes ] directory=/pub
/ppp secret
add name=***** profile=default-encryption remote-address=192.168.88.161 \
    service=l2tp
/system clock
set time-zone-name=Europe/London
/system ntp client
set enabled=yes
/system ntp server
set enabled=yes manycast=yes multicast=yes
/system ntp client servers
add address=xx.xx.xx.xx
add address=yy.yy.yy.y
/system routerboard settings
set enter-setup-on=delete-key
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool mac-server ping
set enabled=no
Currently have a single ISP1 with:

- external traffic to the router itself?? aka VPN LT2P
- external traffic to the LAN?? aka port forwarding to LAN server(s)
- traffic entering/leaving the router by VPN

I will get ISP2 (also PPPoE client) added and temporary requirements are:

- external traffic to the router itself?? aka VPN to stay on ISP1 (unchanged)
- traffic entering/leaving the router by VPN to stay on ISP1 (unchanged)

- external traffic to the LAN?? aka port forwarding to LAN server(s) be split between ISP1 & ISP2 (depending on inbound WAN / NAT)

No need for lout oad balancing, most traffic to go out on IPS2 with only a couple of clients to go out on IPS1 (via Policy Routing with src-address I assume)

I am trying to pre-prepare the config, as I will not want much downtime when the second line gets connected

So far I think that these are really helpful:
viewtopic.php?t=179853
viewtopic.php?t=203165
viewtopic.php?t=189520

But if somebody has good pointers on config with ISP2 added to the mix, it would be most appreciated

Thanks

sebus
Last edited by sebus46 on Fri Apr 05, 2024 8:40 am, edited 4 times in total.
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: Dual-WAN PPPoE +DHCP (LAN clients split routing on same VLAN)

Tue Mar 26, 2024 8:03 am

deleted
Last edited by sebus46 on Fri Apr 05, 2024 8:41 am, edited 1 time in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 12:41 pm

Can you provide a diagram, so far it looks like most of your bridge ports are connected to smart devices (like smart APs and switches) as they are mostly trunk ports......
You can remove this completely useless line.......... bridge ports/vlans deals with data traffic or management vlan.
add bridge=bridge vlan-ids=1
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 12:45 pm

If you have a home subnet .88, then call it vlan88 and make it a vlan and then the config will make sense.
and where is VLAN50 ????
/ip address
add address=192.168.88.1/24 interface=bridge network=192.168.88.0 { wrong }
add address=192.168.99.1/24 interface=vlan99 network=192.168.99.0
add address=192.168.100.1/24 interface=vlan100 network=192.168.100.0
add address=192.168.21.1/29 interface=vlan21 network=192.168.21.0

This is not recommended........... list or not. USE your VPN to access the router and then access winbox. or get rid of the old VPN and use wireguard VPN, much simpler.

add action=accept chain=input comment=\
"Remote access to SSL Mikrotik webif & WinBox" dst-port=443,8291 log=yes \
protocol=tcp src-address-list=Whitelist


Seeing your vpn issues, definitely drop it and use wireugard.
The IP route you creates is for what ???? it doesnt match up with anything!!!
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 1:34 pm

Grateful for the comments, but I was not asking about my current config.

I was asking how to make use of dual-wan (when it is here):

- external traffic to the router itself?? aka VPN to stay on ISP1 (unchanged) - and that works just fine
- traffic entering/leaving the router by VPN to stay on ISP1 (unchanged) - which also works fine

- external traffic to the LAN?? aka port forwarding to LAN server(s) be split between ISP1 & ISP2 (depending on inbound WAN / NAT)

No need for lout oad balancing, most traffic to go out on IPS2 with only a couple of clients to go out on IPS1 (via Policy Routing with src-address I assume)

Thanks

sebus
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 1:37 pm

If you have a home subnet .88, then call it vlan88 and make it a vlan and then the config will make sense.
and where is VLAN50 ????
/ip address
add address=192.168.88.1/24 interface=bridge network=192.168.88.0 { wrong }
add address=192.168.99.1/24 interface=vlan99 network=192.168.99.0
add address=192.168.100.1/24 interface=vlan100 network=192.168.100.0
add address=192.168.21.1/29 interface=vlan21 network=192.168.21.0

This is not recommended........... list or not. USE your VPN to access the router and then access winbox. or get rid of the old VPN and use wireguard VPN, much simpler.

add action=accept chain=input comment=\
"Remote access to SSL Mikrotik webif & WinBox" dst-port=443,8291 log=yes \
protocol=tcp src-address-list=Whitelist


Seeing your vpn issues, definitely drop it and use wireugard.
The IP route you creates is for what ???? it doesnt match up with anything!!!

Vlan 50 is to yet be used (I have to first configure devices to use it, so currently unused)
I have no issues with VPN, it works as I expect it to work (from external PC or iOS device), when I set that up years ago, Wireguard was not an option on iOS

To swap default vlan to VLAN88 is of course possible, but requires full re-config of all network devices around the house (some easier to get to, some more difficult ie switch in the loft), so unagged ports are correct throughout

Remote access rule is perfectly valid for direct Winbox access (which is way easier than VPN from inside another network), from a PC on a remote network, which IP is restricted by Whitelist list
One must agree that there is no ONE-FOR-ALL solution in IT every time, otherwise life would be terribly boring,?

And if you mean:
/ip route
add disabled=no distance=1 dst-address=192.168.2.10/32

then it is also valid to get to web interface of the DSL modem going on the same Ether1 as PPPoE client (when IP 192.168.2.1 is assigned to Ether1 - hacky, but works!
Last edited by sebus46 on Fri Apr 05, 2024 8:42 am, edited 8 times in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 1:53 pm

nm duplicate
Last edited by anav on Tue Mar 26, 2024 1:54 pm, edited 1 time in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 1:54 pm

Lots of threads contain the information you are looking for. Suggest search.
The links you already have seem germane.
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 1:55 pm

OK, will muddle through it
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 1:56 pm

I wont work on a config that is in my opinion hosed, but many others should help when you have specific questions.
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Tue Mar 26, 2024 2:17 pm

Thank you. Appreciate (even if you consider hosed, a basic clean config which fully works - just because something could be done different, that is very authoritarian view)
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: [solved] Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Mon Apr 22, 2024 8:25 pm

Had to use Routing / Rules to "lookup only" in WAN2 table for specific addresses to go out to internet using WAN2
But also had to add additional rules for the same addresses, ABOVE, using main table for the local network access for these devices that are set to use WAN2 table

Otherwise these two clients could not "see" each other locally
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: [solved] Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Mon Apr 22, 2024 8:41 pm

Often the case. Routing rules are powerful as they move all the traffic out that door............ so the trick when using them is to move other traffic first.
Some chap (rplant) came up with a trick to do so, on a one liner, as the first rule in Routing Rules, which is pretty cool.

/routing rule
add action=lookup comment="min-prefix=0, all except 0.0.0.0/0" disabled=no min-prefix=0 table=main


Just an easy way of making all routes that are not 0.0.0.0/0 use the main routing table
 
sebus46
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 17, 2023 4:59 pm

Re: [solved] Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Wed Apr 24, 2024 8:02 pm

That is really nice, thanks

But Winbox GUI cannot handle the display of this rule
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19395
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: [solved] Dual-WAN PPPoE +DHCP (LAN clients on same VLAN split routing, no load balance)

Wed Apr 24, 2024 10:14 pm

I had no issues implementing this in winbox ???

Here is my export line, after doing so!
/routing rule
add action=lookup disabled=no min-prefix=0 table=main


The only thing I did was take the default rule already supplied and added at the very bottom: Min Prefix: 0 and hit apply.

Who is online

Users browsing this forum: handiansudianto, kormenator, mrz, seriosha and 27 guests