Difference between revisions of "BIRD: Static Routing Sederhana"

From OnnoWiki
Jump to navigation Jump to search
(Created page with " center|400px|thumb Router1: /ip address add address=10.1.1.2 interface=ether1 # ether1 kemungkinan dapat DHCP dari gateway Internet add address=172.16....")
 
 
(22 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
[[File:SR1.png|center|400px|thumb]]
 
[[File:SR1.png|center|400px|thumb]]
  
Router1:
 
  
/ip address
+
==Topologi==
add address=10.1.1.2 interface=ether1 # ether1 kemungkinan dapat DHCP dari gateway Internet
 
add address=172.16.1.1/30 interface=ether2
 
add address=192.168.1.1/24 interface=ether3
 
  
  /ip route
+
  R1
  add gateway=10.1.1.1
+
e1 --> CLOUD nat0
  add dst-address=192.168.2.0/24 gateway=172.16.1.2
+
  e2 --> R2 e1
 +
  e3 --> LAN 192.168.1.1/24
  
Router2:
+
R2
 +
e1 --> R1 e2
 +
e2 --> LAN 192.168.2.1/24
  
/ip address
+
Jika menggunakan BIRD appliance di GNS3, maka PC / laptop kita perlu menjalankan
add address=172.16.1.2/30 interface=ether1
 
add address=192.168.2.1/24 interface=ether2
 
  
  /ip route
+
  sudo chown root:onno /dev/kvm
add gateway=172.16.1.1
 
  
Test
+
Tapi jika menggunakan BIRD VirtualBox (dari OpenWRT), kita tidak perlu menjalankan perintah di atas.
  
Router1:
+
==Konfigurasi Shell==
  
  ping 192.168.2.1
+
R1:
 +
 
 +
  ifconfig eth1 192.168.122.100 netmask 255.255.255.0
 +
ifconfig eth2 172.16.1.1 netmask 255.255.255.252
 +
ifconfig eth3 192.168.1.1 netmask 255.255.255.0
 +
 
 +
R2:
 +
 
 +
ifconfig eth1 172.16.1.2 netmask 255.255.255.252
 +
ifconfig eth2 192.168.2.1 netmask 255.255.255.0
 +
 
 +
==Routing==
 +
 
 +
R1:
 +
 
 +
# vi /usr/local/etc/bird6.conf  # BIRD appliance di GNS3
 +
vi /etc/bird.conf              # BIRD di OpenWRT
 +
 
 +
edit
 +
 
 +
router id 172.16.1.1;
 +
protocol kernel {
 +
        import all;
 +
        export all;
 +
        learn;
 +
        scan time 20;
 +
}
 +
protocol device {
 +
        import all;
 +
        export all;
 +
        scan time 10;          # Scan interfaces every 10 seconds
 +
}
 +
protocol static {                                                           
 +
        route 192.168.2.0/24 via 172.16.1.2;                             
 +
}                                                                         
 +
   
 +
 
 +
Restart BIRD
 +
 
 +
# BIRD di OpenWRT
 +
killall zebra
 +
killall bgpd
 +
killall watchquagga
 +
killall ospfd
 +
killall ospf6d
 +
killall ripd
 +
killall ripngd
 +
killall bird4
 +
bird4
 +
 
 +
R2:
 +
 
 +
# vi /usr/local/etc/bird6.conf  # BIRD appliance di GNS3
 +
vi /etc/bird.conf
 +
 
 +
edit
 +
 
 +
router id 172.16.1.2;
 +
protocol kernel {
 +
        import all;
 +
        export all;
 +
        learn;
 +
        scan time 20;
 +
}
 +
protocol device {
 +
        import all;
 +
        export all;
 +
        scan time 10;          # Scan interfaces every 10 seconds
 +
}
 +
protocol static {
 +
        route 192.168.1.0/24 via 172.16.1.1;
 +
}                                         
 +
 +
Restart BIRD
 +
 
 +
# BIRD di OpenWRT
 +
killall zebra
 +
killall bgpd
 +
killall watchquagga
 +
killall ospfd
 +
killall ospf6d
 +
killall ripd
 +
killall ripngd
 +
killall bird4
 +
bird4
 +
 
 +
==Cek==
 +
 
 +
jalankan di shell
  
Router2:
+
birdc4
  
ping 192.168.1.1
+
ketik
  
 +
show interfaces
 +
show static
  
==Tambahan Kalau Membutuhkan NAT==
+
==Test==
  
Router1:
+
R1:
  
  /ip firewall nat add chain=srcnat out-interface=ether1 action=masquareade
+
  ping 172.16.1.2
  /ip firewall nat print
+
  ping 192.168.2.1
  
 +
R2:
  
 +
ping 172.16.1.1
 +
ping 192.168.1.1
  
 
==Setting Client==
 
==Setting Client==
Line 46: Line 135:
 
LAN 1 Client:
 
LAN 1 Client:
  
  ip 192.168.1.2
+
  ip 192.168.1.100/24 192.168.1.1
gw 192.168.1.1
 
  
  
 
LAN 2 Client:
 
LAN 2 Client:
  
  ip 192.168.2.2
+
  ip 192.168.2.100/24 192.168.1.1
gw 192.168.2.1
 
  
 
==Referensi==
 
==Referensi==
  
 
* https://wiki.mikrotik.com/wiki/Manual:Simple_Static_Routing
 
* https://wiki.mikrotik.com/wiki/Manual:Simple_Static_Routing
 
  
  
Line 65: Line 151:
 
* [[TCP/IP: Advanced Routing]]
 
* [[TCP/IP: Advanced Routing]]
 
* [[Quagga]]
 
* [[Quagga]]
 +
* [[VyOS]]
 
* [[Mikrotik]]
 
* [[Mikrotik]]
 
* [[Cisco]]
 
* [[Cisco]]
 
* [[Juniper]]
 
* [[Juniper]]
* [[BIRD: Routing]]
+
* [[BIRD1]]
 +
* [[BIRD2]]
 +
* [[IPv6]]
 +
 
 +
 
 +
* [[TCP/IP: Advanced Routing]]
 +
* [[IPv6: Advanced Routing]]
 +
* [[IPv6: Quagga]]
 +
* [[IPv6: Mikrotik]]
 +
* [[IPv6: Cisco]]
 +
* [[IPv6: Juniper]]
 +
* [[IPv6: BIRD1]]
 +
* [[IPv6: BIRD2]]
 
* [[IPv6]]
 
* [[IPv6]]

Latest revision as of 10:24, 18 January 2019

SR1.png


Topologi

R1
e1 --> CLOUD nat0
e2 --> R2 e1
e3 --> LAN 192.168.1.1/24
R2
e1 --> R1 e2
e2 --> LAN 192.168.2.1/24

Jika menggunakan BIRD appliance di GNS3, maka PC / laptop kita perlu menjalankan

sudo chown root:onno /dev/kvm

Tapi jika menggunakan BIRD VirtualBox (dari OpenWRT), kita tidak perlu menjalankan perintah di atas.

Konfigurasi Shell

R1:

ifconfig eth1 192.168.122.100 netmask 255.255.255.0
ifconfig eth2 172.16.1.1 netmask 255.255.255.252
ifconfig eth3 192.168.1.1 netmask 255.255.255.0

R2:

ifconfig eth1 172.16.1.2 netmask 255.255.255.252
ifconfig eth2 192.168.2.1 netmask 255.255.255.0

Routing

R1:

# vi /usr/local/etc/bird6.conf  # BIRD appliance di GNS3
vi /etc/bird.conf               # BIRD di OpenWRT

edit

router id 172.16.1.1;
protocol kernel {
        import all;
        export all;
        learn;
        scan time 20;
}
protocol device {
        import all;
        export all;
        scan time 10;           # Scan interfaces every 10 seconds
}
protocol static {                                                            
        route 192.168.2.0/24 via 172.16.1.2;                               
}                                                                          
   

Restart BIRD

# BIRD di OpenWRT
killall zebra
killall bgpd
killall watchquagga
killall ospfd
killall ospf6d
killall ripd
killall ripngd
killall bird4
bird4

R2:

# vi /usr/local/etc/bird6.conf  # BIRD appliance di GNS3
vi /etc/bird.conf

edit

router id 172.16.1.2;
protocol kernel {
        import all;
        export all;
        learn;
        scan time 20;
}
protocol device {
        import all;
        export all;
        scan time 10;           # Scan interfaces every 10 seconds
}
protocol static {
        route 192.168.1.0/24 via 172.16.1.1;
}                                           

Restart BIRD

# BIRD di OpenWRT
killall zebra
killall bgpd
killall watchquagga
killall ospfd
killall ospf6d
killall ripd
killall ripngd
killall bird4
bird4

Cek

jalankan di shell

birdc4

ketik

show interfaces
show static

Test

R1:

ping 172.16.1.2
ping 192.168.2.1

R2:

ping 172.16.1.1
ping 192.168.1.1

Setting Client

LAN 1 Client:

ip 192.168.1.100/24 192.168.1.1


LAN 2 Client:

ip 192.168.2.100/24 192.168.1.1

Referensi


Pranala Menarik