Вы находитесь на странице: 1из 31

MTCRE

Training 2011

Routing

Router.md




MikroTik RouterOS

,

MikroTik RouterOS


,


MikroTik RouterOS

?

,
XY
(X , Y )

My number is:_________

B
LA

Lab

Ethernet
192.168.XY.0/24 (.1)
(.254)

Wi-Fi
AP SSID ap-qtraining
IP address 10.1.1.XY/24
wlan1
(GW) DNS
10.1.1.254

Internet

(full)
4

B
LA

B
LA

Lab (.)


(system identity) wireless radio name
XY_< >. : 00_Oleg

Mikrotik RouterOS 5.x ( bios)
Winbox
NTP client
10.1.1.254
backup
(
)
6

Simple Routing

Distance, Policy Routing, ECMP, Scope,


Dead-End and Recursive Next-Hop Resolving
7


(gateway)

()
()



()

0.0.0.0/0

8

B
LA

Lab

4 ,
Z

(cables, wireless) IP-

NAT (masquerade)


(simple static routes)

IP Network Structure
To Main AP

26
/
92
1
Z.
.
8
16

26
0/

2.
9
1

Z.
8.
16
2.
19

10.10.Z.0/30

Z.
8.
16
2.
19

26
8/
12

2.
9
1

26
/
64
.
.Z
8
16

10

!


load balancing ( )?
failover ()?
best path ( )?


?
!

11

ECMP Routes
ECMP (Equal Cost
Multi Path)


(gateway)

(gateway)

Round Robin

SRC / DST

(gateway)
!
12

Check-gateway

(gateways)
ICMP (ping) ARP
(gateway)

(gateway)
ECMP ,
() (gateway)
Round Robin
Check-gateway

(gateway)
13

B
LA

ECMP Lab


ECMP
192.168.XY.0/24 check-gateway
Other participants adjust simple routes to reach each other
without routes though the first participant

ECMP
traceroute
Undo



14

Configuration Example

15

Distance

,
,
distance.
,

distance

16

B
LA

Route Distance Lab


2
:

(clockwise)
Distance=1 check-gateway

(anticlockwise) Distance=2

(redundancy)

(clockwise)
traceroute

17

To Main AP

B
LA

Route Distance Lab


To Laptop

To Laptop

BACKUP
LINK

To Laptop

To Laptop

18

Configuration Example

19



(clockwise)
check-gateway
(failure) ,
,

( )
:

,
,
20

Routing Mark



routing mark
IP firewall
mangle chains prerouting
output

,


( ,

)

(routing mark)
21

B
LA

Routing Policy Lab


(chain prerouting)


( routing-mark)

(redundancy)
(clockwise)
traceroute

22

Mark Routing Rule Example

23

Configuration Example

24

Time To Live (TTL)


TTL - ()
IP-
TTL 64

,

TTL IP firewall mangle

IP c TTL=1
:
NAT

25

Changing TTL

26

B
LA

Clean-up Lab
mangle
IP routes

Leave all IP addresses and network structure


intact

27

Recursive Next-hop Resolving


It is possible to specify gateway to network even
if gateway is not directly reachable by using
recursive next-hop resolving from any existing
route
Useful for setups where middle section between
your router and the gateway is not constant
(iBGP for example)
One route must be in scope of other route for
recursive next-hop resolving to work

28

Scope/Target-Scope
Route's scope contains all routes that scope
value is less or equal to its target-scope value
Example:
0 ADC dst-address=1.1.1.0/24 pref-src=1.1.1.1
interface=ether1 scope=10 target-scope=0
1 A S dst-address=2.2.2.0/24 gateway=1.1.1.254
interface=ether1 scope=30 target-scope=10
2 A S dst-address=3.3.3.0/24 gateway=2.2.2.254
interface=ether1 scope=30 target-scope=30

29

30


Type
(blackhole/prohibit/unreachable)

Preferred Source option points preferred


router source address for locally originated
packets

31

Вам также может понравиться