Community discussions

MikroTik App
just joined
Topic Author
Posts: 1
Joined: Thu Nov 05, 2020 5:02 pm

Help with config

Thu Nov 05, 2020 5:09 pm

Hello, first, I want to thank you for taking the time to read this.
I'm new at Mikrotik and networking in general. Im trying to configure a Mikrotik router to have vlan's (on a bonding to be used with several cisco switches). At the start, I will have 3 wan interfaces (could be more in the future) witch have the same gateway (I want to configure failover and load balance for them).
At the moment I have the followin configuration, and the questions are:

Why have I inter Vlan connection? (Because all vlan are in the Bonding?)
With this configuration, will I be able to have internet access on all vlans?

/interface bridge
add admin-mac=48:8F:6A:10:31:D9 auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether10 ] mac-address=48:8F:5A:12:31:D2
/interface bonding
add mode=802.3ad name=B1 slaves=ether9,ether10 transmit-hash-policy=\
/interface vlan
add interface=B1 name=VLAN_10 vlan-id=10
add interface=B1 name=VLAN_20 vlan-id=20
add interface=B1 name=VLAN_30 vlan-id=30
add interface=B1 name=VLAN_40 vlan-id=40
add interface=B1 name=VLAN_50 vlan-id=50
add interface=B1 name=VLAN_60 vlan-id=60
add interface=B1 name=VLAN_70 vlan-id=70
add interface=B1 name=VLAN_80 vlan-id=80
add interface=B1 name=VLAN_90 vlan-id=90
add interface=B1 name=VLAN_100 vlan-id=100
add interface=B1 name=VLAN_110 vlan-id=110
add interface=B1 name=VLAN_120 vlan-id=120
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=default-dhcp ranges=
add name=POOL_VLAN_10 ranges=
add name=POOL_VLAN_20 ranges=
add name=POOL_VLAN_30 ranges=
add name=POOL_VLAN_40 ranges=
add name=POOL_VLAN_50 ranges=
add name=POOL_VLAN_60 ranges=
add name=POOL_VLAN_70 ranges=
add name=POOL_VLAN_80 ranges=
add name=POOL_VLAN_90 ranges=
add name=POOL_VLAN_100 ranges=
add name=POOL_VLAN_110 ranges=
/ip dhcp-server
add address-pool=default-dhcp interface=bridge name=defconf
add address-pool=POOL_VLAN_10 disabled=no interface=VLAN_10 name=dhcp1
add address-pool=POOL_VLAN_20 disabled=no interface=VLAN_20 name=dhcp2
add address-pool=POOL_VLAN_30 disabled=no interface=VLAN_30 name=dhcp3
add address-pool=POOL_VLAN_40 disabled=no interface=VLAN_40 name=dhcp4
add address-pool=POOL_VLAN_50 disabled=no interface=VLAN_50 name=dhcp5
add address-pool=POOL_VLAN_60 disabled=no interface=VLAN_60 name=dhcp6
add address-pool=POOL_VLAN_70 disabled=no interface=VLAN_70 name=dhcp7
add address-pool=POOL_VLAN_80 disabled=no interface=VLAN_80 name=dhcp8
add address-pool=POOL_VLAN_90 disabled=no interface=VLAN_90 name=dhcp9
add address-pool=POOL_VLAN_100 disabled=no interface=VLAN_100 name=dhcp10
add address-pool=POOL_VLAN_110 disabled=no interface=VLAN_110 name=dhcp11
/interface bridge port
add bridge=bridge interface=VLAN_120
add bridge=bridge interface=ether4
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add interface=bridge list=LAN
add interface=ether1 list=WAN
add interface=VLAN_10 list=LAN
add interface=VLAN_20 list=LAN
add interface=VLAN_30 list=LAN
add interface=VLAN_40 list=LAN
add interface=VLAN_50 list=LAN
add interface=VLAN_60 list=LAN
add interface=VLAN_70 list=LAN
add interface=VLAN_80 list=LAN
add interface=VLAN_90 list=LAN
add interface=VLAN_100 list=LAN
add interface=VLAN_110 list=LAN
add interface=VLAN_120 list=LAN
add interface=B1 list=LAN
add interface=ether2 list=WAN
add interface=ether3 list=WAN
/ip address
add address= comment=defconf interface=ether4 network=
add address= interface=ether1 network=
add address= interface=VLAN_10 network=
add address= interface=VLAN_20 network=
add address= interface=VLAN_30 network=
add address= interface=VLAN_40 network=
add address= interface=VLAN_50 network=
add address= interface=VLAN_60 network=
add address= interface=VLAN_70 network=
add address= interface=VLAN_80 network=
add address= interface=VLAN_90 network=
add address= interface=VLAN_100 network=
add address= interface=VLAN_110 network=
add address= interface=ether2 network=
add address= interface=ether3 network=
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= gateway=
add address= comment=defconf gateway= netmask=24
/ip dns
set servers=,
/ip dns static
add address= comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related disabled=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
add action=drop chain=forward comment="defconf: drop invalid" \
add action=drop chain=forward dst-address= src-address=
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall mangle
add action=mark-connection chain=prerouting connection-state=new \
in-interface=ether1 new-connection-mark=WAN1 passthrough=yes
add action=mark-connection chain=prerouting connection-state=new \
in-interface=ether2 new-connection-mark=WAN2 passthrough=yes
add action=mark-connection chain=prerouting connection-state=new \
in-interface=ether3 new-connection-mark=WAN3 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1 new-routing-mark=\
WAN1_OUT passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2 new-routing-mark=\
WAN2_OUT passthrough=yes
add action=mark-routing chain=output connection-mark=WAN3 new-routing-mark=\
WAN3_OUT passthrough=yes
add action=mark-connection chain=prerouting connection-state=new \
dst-address-type=!local in-interface=B1 new-connection-mark=WAN1 \
passthrough=yes per-connection-classifier=both-addresses:3/0
add action=mark-connection chain=prerouting connection-state=new \
dst-address-type=!local in-interface=B1 new-connection-mark=WAN2 \
passthrough=yes per-connection-classifier=both-addresses:3/1
add action=mark-connection chain=prerouting connection-state=new \
dst-address-type=!local in-interface=B1 new-connection-mark=WAN3 \
passthrough=yes per-connection-classifier=both-addresses:3/2
add action=mark-routing chain=prerouting connection-mark=WAN1 in-interface=B1 \
new-routing-mark=WAN1_OUT passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2 in-interface=B1 \
new-routing-mark=WAN2_OUT passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN3 in-interface=B1 \
new-routing-mark=WAN3_OUT passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
add action=masquerade chain=srcnat out-interface=ether3
/ip route
add check-gateway=ping distance=1 gateway= \
add check-gateway=ping distance=1 gateway= \
add check-gateway=ping distance=1 gateway= \
add check-gateway=ping distance=1 gateway=
/system identity
set name=RouterMikrotik
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

Who is online

Users browsing this forum: Baidu [Spider], Daniel44, martinclaro, Theseth and 202 guests