Community discussions

MikroTik App
 
Sl33py
newbie
Topic Author
Posts: 25
Joined: Mon Jan 20, 2014 2:37 pm

Dual WAN with policy routing

Mon Nov 30, 2015 10:49 am

Good day
I have 2 companies that share IT infrastructure in one building, they share 2 servers for data and email. The internet is a problem as the 2 companies have different needs and we added a second ADSL line for them so each company can have its own connection.

I want to split the traffic with sub netting. below is my configuration, I used a RB750 that was setup by another company.
Everything works from the outside and I can connect to the router via either WAN port but I cant get internet via the new WAN port.

eth1 = pppoe-uncapped
eth2= 192.168.0.2 (Marturia GW)
eth5/Harcourts = WAN for 2nd PPOE 192.168.0.254
192.168.0.1 - 127 Marturia
192.168.0.128 -254 Harcourts

There is a old bridge on the router I am not sure about and don't understand (I am new to this) also would i need to have another cable into say port 4 like what is happening with 1 and 2. I might be missing some fundamental steps here as i am a noob

/interface bridge
add admin-mac=00:00:00:00:00:00 ageing-time=5m arp=enabled auto-mac=yes disabled=no forward-delay=15s l2mtu=65535 max-message-age=20s mtu=1500 name=loopback \
priority=0x8000 protocol-mode=none transmit-hold-count=6
/interface pppoe-client
add ac-name="" add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=ether1 max-mru=1480 max-mtu=1480 mrru=disabled name=\
pppoe-uncapped password=*** profile=default service-name="" use-peer-dns=no user=****@***.net
add ac-name="" add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=Harcourts max-mru=1480 max-mtu=1480 mrru=disabled \
name=pppoe-harcourts password=*** profile=default service-name="" use-peer-dns=no user=s***@***.co.za
/interface ethernet switch
set 0 mirror-source=none mirror-target=none name=switch1
/interface wireless security-profiles
set [ find default=yes ] authentication-types="" eap-methods=passthrough group-ciphers=aes-ccm group-key-update=5m interim-update=0s management-protection=\
disabled management-protection-key="" mode=none name=default radius-eap-accounting=no radius-mac-accounting=no radius-mac-authentication=no \
radius-mac-caching=disabled radius-mac-format=XX:XX:XX:XX:XX:XX radius-mac-mode=as-username static-algo-0=none static-algo-1=none static-algo-2=none \
static-algo-3=none static-key-0="" static-key-1="" static-key-2="" static-key-3="" static-sta-private-algo=none static-sta-private-key="" \
static-transmit-key=key-0 supplicant-identity=Manie_**** tls-certificate=none tls-mode=no-certificates unicast-ciphers=aes-ccm wpa-pre-shared-key="" \
wpa2-pre-shared-key=""
/interface bridge settings
set use-ip-firewall=no use-ip-firewall-for-pppoe=no use-ip-firewall-for-vlan=no
/interface ethernet switch port
set 0 vlan-header=leave-as-is vlan-mode=fallback
set 1 vlan-header=leave-as-is vlan-mode=fallback
set 2 vlan-header=leave-as-is vlan-mode=fallback
set 3 vlan-header=leave-as-is vlan-mode=fallback
set 4 vlan-header=leave-as-is vlan-mode=fallback
set 5 vlan-header=leave-as-is vlan-mode=fallback
/interface l2tp-server server
set authentication=pap,chap,mschap1,mschap2 default-profile=default-encryption enabled=no keepalive-timeout=30 max-mru=1460 max-mtu=1460 mrru=disabled
/interface ovpn-server server
set auth=sha1,md5 certificate=none cipher=blowfish128,aes128 default-profile=default enabled=no keepalive-timeout=60 mac-address=FE:3B:F7:85:99:81 max-mtu=1500 \
mode=ip netmask=24 port=1194 require-client-certificate=no

/interface pptp-server server
set authentication=pap,chap,mschap1,mschap2 default-profile=vpn enabled=yes keepalive-timeout=30 max-mru=1460 max-mtu=1460 mrru=disabled
/interface sstp-server server
set authentication=pap,chap,mschap1,mschap2 certificate=none default-profile=default enabled=no keepalive-timeout=60 max-mru=1500 max-mtu=1500 mrru=disabled \
port=443 verify-client-certificate=no
/interface wireless align
set active-mode=yes audio-max=-20 audio-min=-100 audio-monitor=00:00:00:00:00:00 filter-mac=00:00:00:00:00:00 frame-size=300 frames-per-second=25 receive-all=\
no ssid-all=no
/interface wireless sniffer
set channel-time=200ms file-limit=10 file-name="" memory-limit=10 multiple-channels=no only-headers=no receive-errors=no streaming-enabled=no \
streaming-max-rate=0 streaming-server=0.0.0.0
/interface wireless snooper
set channel-time=200ms multiple-channels=yes receive-errors=no

[admin@Manie_****] /ip firewall> export
# nov/27/2015 16:25:14 by RouterOS 5.26
# software id = 4P9D-BMBM
#
/ip firewall connection tracking
set enabled=yes generic-timeout=10m icmp-timeout=10s tcp-close-timeout=10s tcp-close-wait-timeout=10s tcp-established-timeout=1d tcp-fin-wait-timeout=10s \
tcp-last-ack-timeout=10s tcp-syn-received-timeout=5s tcp-syn-sent-timeout=5s tcp-syncookie=no tcp-time-wait-timeout=10s udp-stream-timeout=3m udp-timeout=\
10s
/ip firewall filter
add action=log chain=forward comment="log port 25 not from server" disabled=no dst-port=25 log-prefix="smtp spammer" protocol=tcp src-address=!192.168.0.61
add action=drop chain=forward comment="drop all smtp not 192.168.0.61" disabled=no dst-port=25 protocol=tcp src-address=!192.168.0.61
add action=drop chain=forward disabled=no in-interface=ether1 port=53 protocol=udp
add action=drop chain=forward disabled=no in-interface=ether1 port=53 protocol=tcp
/ip firewall mangle
add action=mark-routing chain=prerouting comment="Marturia via SAINET" disabled=no new-routing-mark=Marturia passthrough=no src-address=192.168.0.0/25
add action=mark-routing chain=prerouting comment="Harcourts via PC Square" disabled=no new-routing-mark=Harcourts passthrough=no src-address=192.168.0.128/25
/ip firewall nat
add action=redirect chain=dstnat disabled=no dst-port=53 in-interface=ether2 protocol=udp to-ports=53
add action=dst-nat chain=dstnat disabled=no dst-port=25 in-interface=ether2 protocol=tcp to-addresses=197.221.165.106 to-ports=25
add action=masquerade chain=srcnat disabled=no out-interface=pppoe-uncapped
add action=masquerade chain=srcnat disabled=no out-interface=pppoe-harcourts



/ip route
add comment="Route for Marturia" disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=pppoe-uncapped routing-mark=Marturia scope=30 target-scope=10
add comment="Route for Harcourts" disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=pppoe-harcourts routing-mark=Harcourts scope=30 target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-uncapped scope=30 target-scope=10


[admin@Manie_****] /ip address> export
# nov/27/2015 16:28:59 by RouterOS 5.26
# software id = 4P9D-BMBM
#
/ip address
add address=127.0.0.1/32 disabled=no interface=loopback network=127.0.0.1
add address=192.168.0.2/24 disabled=no interface=ether2 network=192.168.0.0
add address=192.168.0.254/24 disabled=no interface=Harcourts network=192.168.0.0
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Dual WAN with policy routing

Mon Nov 30, 2015 11:35 am

Have a look at tyhis presentation: http://mum.mikrotik.com/presentations/US12/tomas.pdf it will make things clearer for you.
 
Sl33py
newbie
Topic Author
Posts: 25
Joined: Mon Jan 20, 2014 2:37 pm

Re: Dual WAN with policy routing

Tue Dec 01, 2015 7:19 am

I have seen that one but this is the one I followed

http://wiki.mikrotik.com/wiki/Load_Bala ... e_Gateways

The must not share the WAN unless one route goes down or do I need to add some of that config to the above post?
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Dual WAN with policy routing

Tue Dec 01, 2015 7:02 pm

If you want to add failover, just need to add two more routes, with higher metrics: one for GroupA BUT with the other WAN as gateway, and one for GroupB with the other WAN as gateway.

The lower metrics are preferred by RouterOS; with both WANs operative each group will use their respective WAN; the second, higher-metrics, "reversed" gateways routes will only be used in the event of one WAN failing.

Who is online

Users browsing this forum: Ahrefs [Bot], Candide, Kanzler and 97 guests