Community discussions

MikroTik App
 
agustinMik
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=\
layer-2-and-3
/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=192.168.88.10-192.168.88.254
add name=POOL_VLAN_10 ranges=10.0.1.100-10.0.1.200
add name=POOL_VLAN_20 ranges=10.0.2.100-10.0.2.200
add name=POOL_VLAN_30 ranges=10.0.3.100-10.0.3.200
add name=POOL_VLAN_40 ranges=10.0.4.100-10.0.4.200
add name=POOL_VLAN_50 ranges=10.0.5.100-10.0.5.200
add name=POOL_VLAN_60 ranges=10.0.6.100-10.0.6.200
add name=POOL_VLAN_70 ranges=10.0.7.100-10.0.7.200
add name=POOL_VLAN_80 ranges=10.0.8.100-10.0.8.200
add name=POOL_VLAN_90 ranges=10.0.9.100-10.0.9.200
add name=POOL_VLAN_100 ranges=10.0.10.100-10.0.10.200
add name=POOL_VLAN_110 ranges=10.0.11.100-10.0.11.200
/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=10.0.12.20/24 comment=defconf interface=ether4 network=10.0.12.0
add address=200.109.142.178/28 interface=ether1 network=200.109.142.176
add address=10.0.1.1/24 interface=VLAN_10 network=10.0.1.0
add address=10.0.2.1/24 interface=VLAN_20 network=10.0.2.0
add address=10.0.3.1/24 interface=VLAN_30 network=10.0.3.0
add address=10.0.4.1/24 interface=VLAN_40 network=10.0.4.0
add address=10.0.5.1/24 interface=VLAN_50 network=10.0.5.0
add address=10.0.6.1/24 interface=VLAN_60 network=10.0.6.0
add address=10.0.7.1/24 interface=VLAN_70 network=10.0.7.0
add address=10.0.8.1/24 interface=VLAN_80 network=10.0.8.0
add address=10.0.9.1/24 interface=VLAN_90 network=10.0.9.0
add address=10.0.10.1/24 interface=VLAN_100 network=10.0.10.0
add address=10.0.11.1/24 interface=VLAN_110 network=10.0.11.0
add address=200.109.142.179/28 interface=ether2 network=200.109.142.176
add address=200.109.142.180/28 interface=ether3 network=200.109.142.176
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=10.0.1.0/24 gateway=10.0.1.1
add address=10.0.2.0/24 gateway=10.0.2.1
add address=10.0.3.0/24 gateway=10.0.3.1
add address=10.0.4.0/24 gateway=10.0.4.1
add address=10.0.5.0/24 gateway=10.0.5.1
add address=10.0.6.0/24 gateway=10.0.6.1
add address=10.0.7.0/24 gateway=10.0.7.1
add address=10.0.8.0/24 gateway=10.0.8.1
add address=10.0.9.0/24 gateway=10.0.9.1
add address=10.0.10.0/24 gateway=10.0.10.1
add address=10.0.11.0/24 gateway=10.0.11.1
add address=10.0.12.0/24 comment=defconf gateway=10.0.12.20 netmask=24
/ip dns
set servers=200.109.192.4,200.109.192.5
/ip dns static
add address=10.0.12.20 comment=defconf name=router.lan
/ip firewall filter
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="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
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=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward dst-address=10.0.0.0/16 src-address=10.0.0.0/16
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=200.109.142.177%ether1 \
routing-mark=WAN1
add check-gateway=ping distance=1 gateway=200.109.142.177%ether2 \
routing-mark=WAN2
add check-gateway=ping distance=1 gateway=200.109.142.177%ether3 \
routing-mark=WAN3
add check-gateway=ping distance=1 gateway=200.109.142.177
/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