Difference between revisions of "Mikrotik: OSPF Sederhana distribute default routing"

From OnnoWiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[File:Image6005.gif|center|400px|thumb]]
+
[[File:Image6006.gif|center|900px|thumb]]
  
 +
==Topology Jaringan==
  
Router1:
+
R1:
 +
eth0: -- R2: eth0
 +
eth1: -- R3: eth0
  
/ip address add address=10.10.1.1/30 interface=ether1
+
R2:
  /ip address add address=10.10.1.5/30 interface=ether2
+
  eth0: -- R1: eth0
  /ip dhcp-client add interface=ether3 disabled=no
+
  eth1: -- R4: eth0
  /ip firewall nat add chain=srcnat out-interface=ether3 action=masquareade
+
  eth2: -- nat0: Internet
/ip firewall nat print
 
/routing ospf network add network=10.10.1.0/24 area=backbone
 
  
Router2:
+
R3:
 +
eth0: -- R1: eth1
 +
eth1: -- LAN: 192.168.1.1/24
  
/ip address add address=10.10.1.6/30 interface=ether1
+
R4:
/ip address add address=10.10.1.9/30 interface=ether2
+
  eth0: -- R2: eth1
  /ip address add address=172.16.1.1/16 interface=ether3
+
  eth1: -- LAN: 192.168.2.1/24
  /routing ospf network add network=172.16.0.0/16 area=backbone
 
/routing ospf network add network=10.10.1.0/24 area=backbone
 
  
Router3:
+
==Setup IP address==
  
/ip address add address=10.10.1.2/30 interface=ether1
+
R1:
/ip address add address=10.10.1.10/30 interface=ether2
 
/ip address add address=192.168.1.1/24 interface=ether3
 
/routing ospf network add network=192.168.1.0/24 area=backbone
 
/routing ospf network add network=10.10.1.0/24 area=backbone
 
  
 +
/ip address add address=10.0.1.1/30 interface=ether1
 +
/ip address add address=10.1.1.1/30 interface=ether2
  
Cek
+
R2:
  
/routing ospf instance print
 
  
  Flags: X - disabled
+
  /ip address add address=10.0.1.2/30 interface=ether1
  0  name="default" router-id=0.0.0.0 distribute-default=never
+
/ip address add address=10.1.2.1/30 interface=ether2
      redistribute-connected=as-type-1 redistribute-static=as-type-1  
+
/ip address add address=192.168.122.100/24 interface=ether3
      redistribute-rip=no redistribute-bgp=no redistribute-other-ospf=no
+
/ip address add address=192.168.122.101/24 interface=ether3
      metric-default=1 metric-connected=20 metric-static=20 metric-rip=20
+
  /ip address add address=192.168.122.102/24 interface=ether3
      metric-bgp=auto metric-other-ospf=auto in-filter=ospf-in
 
  out-filter=ospf-out
 
  
 +
/ip dhcp-client add interface=ether3 disabled=no        # kalau ether3 DHCP client
 +
/ip firewall nat add chain=srcnat out-interface=ether3 action=masquerade
 +
/ip firewall nat print
  
Catatan: Ingat bahwa backbone area-id adalah 0.0.0.0.
+
/ip route add dst-address=0.0.0.0/0 gateway=192.168.122.1
  
==Tambahan untuk distribute default routing==
+
R3:
  
R1:
+
/ip address add address=10.1.1.2/30 interface=ether1
 +
/ip address add address=192.168.1.1/24 interface=ether2
  
/routing ospf instance
+
R4:
set [ find default=yes ] distribute-default=always-as-type-1 \
 
    redistribute-connected=as-type-1 router-id=10.10.1.1
 
/ip dns set servers=8.8.8.8
 
  
R2:
+
/ip address add address=10.1.2.2/30 interface=ether1
 +
/ip address add address=192.168.2.1/24 interface=ether2
  
/routing ospf instance
+
==Setup OSPF==
set [ find default=yes ] router-id=10.10.1.6
 
/ip dns set servers=8.8.8.8
 
  
R3:
+
R1:
  
 +
/routing ospf instance enable default
 +
/routing ospf area add name=area1 area-id=0.0.0.1
 +
/routing ospf network add network=10.0.1.0/24 area=backbone
 +
/routing ospf network add network=10.1.1.0/30 area=area1
 +
/routing ospf interface
 +
    add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
 +
/routing ospf interface
 +
    add interface=ether2 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
  
/routing ospf instance
+
R2:
set [ find default=yes ] router-id=10.10.1.2
 
/ip dns set servers=8.8.8.8
 
  
==Verify==
+
/routing ospf instance enable default
 +
/routing ospf area add name=area2 area-id=0.0.0.2
 +
/routing ospf network add network=10.0.1.0/24 area=backbone
 +
/routing ospf network add network=10.1.2.0/30 area=area2
 +
/routing ospf interface
 +
    add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
 +
/routing ospf interface
 +
    add interface=ether2 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
  
Cek
 
  
R1:
+
/routing ospf instance set distribute-default=if-installed-as-type-1 numbers=0
  
/routing ospf interface print
 
/routing ospf neighbor print
 
/ip route print
 
  
Lakukan yang sama untuk R2, R3
+
R3 configuration:
  
 +
/routing ospf instance enable default
 +
/routing ospf area add name=area1 area-id=0.0.0.1
 +
/routing ospf network add network=10.1.1.0/30 area=area1
 +
/routing ospf network add network=192.168.1.0/24 area=area1
 +
/routing ospf interface
 +
    add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
  
 +
R4 configuration:
  
 +
/routing ospf instance enable default
 +
/routing ospf area add name=area2 area-id=0.0.0.2
 +
/routing ospf network add network=10.1.2.0/30 area=area2
 +
/routing ospf network add network=192.168.2.0/24 area=area2
 +
/routing ospf interface
 +
    add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
  
 +
==Cek route==
  
 +
R3:
  
 +
/routing ospf interface print
 +
/routing ospf neighbor print
 +
/ip route print
 +
   
 +
Redistribute Connected
  
 +
/routing ospf instance set 0 redistribute-connected=as-type-1
 +
/routing ospf instance print
  
==Referensi==
+
Cek
 
 
* https://wiki.mikrotik.com/wiki/Manual:OSPF-examples
 
  
 +
/routing ospf interface print
 +
/routing ospf neighbor print
 +
/ip route print
  
 
==Pranala Menarik==
 
==Pranala Menarik==
  
 +
* [[TCP/IP: Advanced Routing]]
 +
* [[Quagga]]
 
* [[Mikrotik]]
 
* [[Mikrotik]]
 +
* [[Cisco]]
 +
* [[Juniper]]
 +
* [[BIRD: Routing]]
 +
* [[IPv6]]

Latest revision as of 08:08, 2 January 2019

Image6006.gif

Topology Jaringan

R1:

eth0: -- R2: eth0
eth1: -- R3: eth0

R2:

eth0: -- R1: eth0
eth1: -- R4: eth0
eth2: -- nat0: Internet

R3:

eth0: -- R1: eth1
eth1: -- LAN: 192.168.1.1/24

R4:

eth0: -- R2: eth1
eth1: -- LAN: 192.168.2.1/24

Setup IP address

R1:

/ip address add address=10.0.1.1/30 interface=ether1
/ip address add address=10.1.1.1/30 interface=ether2

R2:


/ip address add address=10.0.1.2/30 interface=ether1
/ip address add address=10.1.2.1/30 interface=ether2
/ip address add address=192.168.122.100/24 interface=ether3
/ip address add address=192.168.122.101/24 interface=ether3
/ip address add address=192.168.122.102/24 interface=ether3
/ip dhcp-client add interface=ether3 disabled=no        # kalau ether3 DHCP client
/ip firewall nat add chain=srcnat out-interface=ether3 action=masquerade 
/ip firewall nat print
/ip route add dst-address=0.0.0.0/0 gateway=192.168.122.1

R3:

/ip address add address=10.1.1.2/30 interface=ether1
/ip address add address=192.168.1.1/24 interface=ether2

R4:

/ip address add address=10.1.2.2/30 interface=ether1
/ip address add address=192.168.2.1/24 interface=ether2

Setup OSPF

R1:

/routing ospf instance enable default
/routing ospf area add name=area1 area-id=0.0.0.1
/routing ospf network add network=10.0.1.0/24 area=backbone
/routing ospf network add network=10.1.1.0/30 area=area1
/routing ospf interface 
   add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
/routing ospf interface 
   add interface=ether2 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1

R2:

/routing ospf instance enable default
/routing ospf area add name=area2 area-id=0.0.0.2
/routing ospf network add network=10.0.1.0/24 area=backbone
/routing ospf network add network=10.1.2.0/30 area=area2
/routing ospf interface 
   add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1
/routing ospf interface 
   add interface=ether2 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1


/routing ospf instance set distribute-default=if-installed-as-type-1 numbers=0


R3 configuration:

/routing ospf instance enable default
/routing ospf area add name=area1 area-id=0.0.0.1
/routing ospf network add network=10.1.1.0/30 area=area1
/routing ospf network add network=192.168.1.0/24 area=area1
/routing ospf interface 
   add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1

R4 configuration:

/routing ospf instance enable default
/routing ospf area add name=area2 area-id=0.0.0.2
/routing ospf network add network=10.1.2.0/30 area=area2
/routing ospf network add network=192.168.2.0/24 area=area2
/routing ospf interface 
   add interface=ether1 authentication=md5 authentication-key=$AP7i1 authentication-key-id=1

Cek route

R3:

/routing ospf interface print
/routing ospf neighbor print
/ip route print 
    

Redistribute Connected

/routing ospf instance set 0 redistribute-connected=as-type-1 
/routing ospf instance print 

Cek

/routing ospf interface print
/routing ospf neighbor print
/ip route print

Pranala Menarik