52
Kinsey Computers cc

Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 2: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

» David Bisschoff

» Durban, South Africa

» Work at Kinsey Computers

» Discovered MikroTik in 2011

Kinsey Computers cc

Page 3: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

» Steve Discher˃ MUM - USA Sep 2012

˃ RouterOS by Example

» Greg Sowell˃ http://gregsowell.com

» Syed Jahanzaib˃ http://aacable.wordpress.com/category/mikrotik-related/

» YouTube / Google

Kinsey Computers cc

Page 4: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

» Load Balancing is methology with aim to spread traffic across multiple links to get better links usage.

Kinsey Computers cc

Page 5: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

» When Telkom Line goes down – how to failover?

Page 6: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 7: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 8: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall address-list

add address=192.168.1.0/24 disabled=no list=GW01_LAN

Kinsey Computers cc

Page 9: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 10: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 11: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 12: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangle

add chain=prerouting dst-address-list=GW01_LAN src-address-list=GW01_LAN

Kinsey Computers cc

Page 13: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 14: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 15: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangleadd action=mark-connection chain=forward connection-mark=no-mark \

in-interface=pppoe-1 new-connection-mark=ISP1_conn passthrough=noadd action=mark-connection chain=forward connection-mark=no-mark \

in-interface=pppoe-2 new-connection-mark=ISP2_conn passthrough=noadd action=mark-connection chain=forward connection-mark=no-mark \

in-interface=pppoe-3 new-connection-mark=ISP3_conn passthrough=noadd action=mark-connection chain=forward connection-mark=no-mark \

in-interface=pppoe-4 new-connection-mark=ISP4_conn passthrough=no

Kinsey Computers cc

Page 16: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 17: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 18: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangle

add action=mark-connection chain=prerouting connection-mark=no-mark \

in-interface=pppoe-1 new-connection-mark=ISP1_conn

add action=mark-connection chain=prerouting connection-mark=no-mark \

in-interface=pppoe-2 new-connection-mark=ISP2_conn

add action=mark-connection chain=prerouting connection-mark=no-mark \

in-interface=pppoe-3 new-connection-mark=ISP3_conn

add action=mark-connection chain=prerouting connection-mark=no-mark \

in-interface=pppoe-4 new-connection-mark=ISP4_conn

Kinsey Computers cc

Page 19: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 20: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 21: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangle

add action=jump chain=prerouting connection-mark=no-mark in-interface=LAN \

jump-target=policy_routing

Kinsey Computers cc

Page 22: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 23: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 24: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 25: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangleadd action=mark-routing chain=prerouting connection-mark=ISP1_conn \

new-routing-mark=ISP1_traffic src-address-list=GW01_LANadd action=mark-routing chain=prerouting connection-mark=ISP2_conn \

new-routing-mark=ISP2_traffic src-address-list=GW01_LANadd action=mark-routing chain=prerouting connection-mark=ISP3_conn \

new-routing-mark=ISP3_traffic src-address-list=GW01_LANadd action=mark-routing chain=prerouting connection-mark=ISP4_conn \

new-routing-mark=ISP4_traffic src-address-list=GW01_LAN

Kinsey Computers cc

Page 26: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 27: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 28: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangle

add action=mark-routing chain=output connection-mark=ISP1_conn \

new-routing-mark=ISP1_traffic

add action=mark-routing chain=output connection-mark=ISP2_conn \

new-routing-mark=ISP2_traffic

add action=mark-routing chain=output connection-mark=ISP3_conn \

new-routing-mark=ISP3_traffic

add action=mark-routing chain=output connection-mark=ISP4_conn \

new-routing-mark=ISP4_traffic

Kinsey Computers cc

Page 29: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 30: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 31: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 32: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 33: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangleadd action=mark-connection chain=policy_routing dst-address-type=!local \

new-connection-mark=ISP1_conn per-connection-classifier=\both-addresses:4/0

add action=mark-connection chain=policy_routing dst-address-type=!local \new-connection-mark=ISP2_conn per-connection-classifier=\both-addresses:4/1

add action=mark-connection chain=policy_routing dst-address-type=!local \new-connection-mark=ISP3_conn per-connection-classifier=\both-addresses:4/2

add action=mark-connection chain=policy_routing dst-address-type=!local \new-connection-mark=ISP4_conn per-connection-classifier=\both-addresses:4/3

Kinsey Computers cc

Page 34: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 35: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 36: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip routeadd check-gateway=arp distance=1 gateway=pppoe-1 routing-mark=ISP1_trafficadd check-gateway=arp distance=1 gateway=pppoe-2 routing-mark=ISP2_trafficadd check-gateway=arp distance=1 gateway=pppoe-3 routing-mark=ISP3_trafficadd check-gateway=arp distance=1 gateway=pppoe-4 routing-mark=ISP4_trafficadd check-gateway=arp distance=2 gateway=pppoe-1add check-gateway=arp distance=3 gateway=pppoe-2add check-gateway=arp distance=4 gateway=pppoe-3add check-gateway=arp distance=5 gateway=pppoe-4

Kinsey Computers cc

Page 37: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 38: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 39: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 40: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 41: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 42: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall natadd action=dst-nat chain=dstnat comment=\

"Port Forward tcp 80 to Mail Server 192.168.1.10" dst-port=80 \in-interface=!LAN protocol=tcp to-addresses=192.168.1.10 to-ports=80

add action=dst-nat chain=dstnat comment=\"Port Forward tcp 443 to Mail Server 192.168.1.10" dst-port=443 \in-interface=!LAN protocol=tcp to-addresses=192.168.1.10 to-ports=443

Kinsey Computers cc

Page 43: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Problems? Why would there be any problems?

Kinsey Computers cc

Page 44: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

HTTPS?

Certain secure websites don’t work.

e.g. Internet Banking with two factor authentication

(PIN then Username and Password)

Kinsey Computers cc

Page 45: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 46: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 47: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip firewall mangle

add action=mark-routing chain=prerouting disabled=no dst-port=443 \

new-routing-mark=HTTPS passthrough=no protocol=tcp

Kinsey Computers cc

Page 48: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Kinsey Computers cc

Page 49: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

/ip route

add check-gateway=arp disabled=no distance=7 dst-address=0.0.0.0/0 gateway=\

pppoe-1 routing-mark=HTTPS scope=30 target-scope=10

add check-gateway=arp disabled=no distance=8 dst-address=0.0.0.0/0 gateway=\

pppoe-2 routing-mark=HTTPS scope=30 target-scope=10

add check-gateway=arp disabled=no distance=9 dst-address=0.0.0.0/0 gateway=\

pppoe-3 routing-mark=HTTPS scope=30 target-scope=10

add check-gateway=arp disabled=no distance=10 dst-address=0.0.0.0/0 gateway=\

pppoe-5 routtng-mark=HTTPS scope=30 target-scope=10

Kinsey Computers cc

Page 50: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Help?

1. Make my solution more efficient and allow HTTPS traffic to Load Balance properly.

2. How to Load Balance with Web Proxy.

Kinsey Computers cc

Page 51: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

Simple User Traffic Logs

1. MikroTik Router

2. Raspberry Pi

Setup a Raspberry Pi as a Web Proxy (no caching) for Monitoring Internet Usage.

Kinsey Computers cc

Page 52: Kinsey Computers cc - MikroTik · »David Bisschoff » Durban, South Africa » Work at Kinsey Computers » Discovered MikroTik in 2011 Kinsey Computers cc

David Bisschoff

http://mikrotik.Bisschoff.com

Kinsey Computers cc