Difference between revisions of "BIRD2: Static Routing Sederhana"

From OnnoWiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 46: Line 46:
 
  ipv4 table master4;
 
  ipv4 table master4;
 
  ipv6 table master6;
 
  ipv6 table master6;
 
 
  ipv4 table mcast4;
 
  ipv4 table mcast4;
 
  ipv6 table mcast6;
 
  ipv6 table mcast6;
 
 
  ipv4 table mtab4;
 
  ipv4 table mtab4;
 
  ipv6 table mtab6;
 
  ipv6 table mtab6;
 
 
  vpn4 table vpntab4;
 
  vpn4 table vpntab4;
 
  vpn6 table vpntab6;
 
  vpn6 table vpntab6;
 
 
  vpn4 table vpn4mc;
 
  vpn4 table vpn4mc;
 
  vpn6 table vpn6mc;
 
  vpn6 table vpn6mc;
 
 
  flow4 table flowtab4;
 
  flow4 table flowtab4;
 
  flow6 table flowtab6;
 
  flow6 table flowtab6;
Line 64: Line 59:
 
  protocol device {
 
  protocol device {
 
  }
 
  }
                                                                 
+
protocol kernel kernel4 {
  protocol static static4 {                                                
+
        ipv4 {
         ipv4;                                                            
+
                export all;
         route 192.168.2.0/24 via 172.16.1.2;                              
+
        };
  }                                                                        
+
}
   
+
protocol direct {
 +
        ipv4;
 +
        interface "eth0" , "eth1" , "eth2" ;
 +
}
 +
  protocol static static4 {
 +
         ipv4;
 +
         route 192.168.2.0/24 via 172.16.1.2;
 +
  }
  
 
Restart BIRD
 
Restart BIRD
Line 99: Line 101:
 
  ipv4 table master4;
 
  ipv4 table master4;
 
  ipv6 table master6;
 
  ipv6 table master6;
                   
 
 
  ipv4 table mcast4;
 
  ipv4 table mcast4;
 
  ipv6 table mcast6;
 
  ipv6 table mcast6;
                 
 
 
  ipv4 table mtab4;
 
  ipv4 table mtab4;
 
  ipv6 table mtab6;
 
  ipv6 table mtab6;
                 
 
 
  vpn4 table vpntab4;
 
  vpn4 table vpntab4;
 
  vpn6 table vpntab6;
 
  vpn6 table vpntab6;
                 
 
 
  vpn4 table vpn4mc;
 
  vpn4 table vpn4mc;
 
  vpn6 table vpn6mc;
 
  vpn6 table vpn6mc;
                   
 
 
  flow4 table flowtab4;
 
  flow4 table flowtab4;
 
  flow6 table flowtab6;
 
  flow6 table flowtab6;
Line 117: Line 114:
 
  protocol device {
 
  protocol device {
 
  }
 
  }
   
+
  protocol kernel kernel4 {
 +
        ipv4 {
 +
                export all;
 +
        };
 +
}
 +
protocol direct {
 +
        ipv4;
 +
        interface "eth0" , "eth1" , "eth2" ;
 +
}
 
  protocol static static4 {
 
  protocol static static4 {
         ipv4;                              
+
         ipv4;
 
         route 192.168.1.0/24 via 172.16.1.1;
 
         route 192.168.1.0/24 via 172.16.1.1;
  }                                          
+
  }
+
 
 
Restart BIRD
 
Restart BIRD
  
Line 144: Line 149:
 
jalankan di shell
 
jalankan di shell
  
  birdcl
+
  birdc
  
 
ketik
 
ketik
Line 150: Line 155:
 
  show interfaces
 
  show interfaces
 
  show static
 
  show static
 +
show protocols
 +
show protocols all static4
 +
show route
  
 
==Test==
 
==Test==

Latest revision as of 05:15, 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;

ipv4 table master4;
ipv6 table master6;
ipv4 table mcast4;
ipv6 table mcast6;
ipv4 table mtab4;
ipv6 table mtab6;
vpn4 table vpntab4;
vpn6 table vpntab6;
vpn4 table vpn4mc;
vpn6 table vpn6mc;
flow4 table flowtab4;
flow6 table flowtab6;

protocol device {
}
protocol kernel kernel4 {
        ipv4 {
                export all;
        };
}
protocol direct {
        ipv4;
        interface "eth0" , "eth1" , "eth2" ;
}
protocol static static4 {
        ipv4;
        route 192.168.2.0/24 via 172.16.1.2;
}

Restart BIRD

# BIRD appliance di GNS3
# killall bird6
# /usr/local/sbin/bird6 -u gns3 -g staff &
# BIRD di OpenWRT
killall zebra
killall bgpd
killall watchquagga
killall ospfd
killall ospf6d
killall ripd
killall ripngd
killall bird
bird

R2:

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

edit

router id 172.16.1.2;

ipv4 table master4;
ipv6 table master6;
ipv4 table mcast4;
ipv6 table mcast6;
ipv4 table mtab4;
ipv6 table mtab6;
vpn4 table vpntab4;
vpn6 table vpntab6;
vpn4 table vpn4mc;
vpn6 table vpn6mc;
flow4 table flowtab4;
flow6 table flowtab6;

protocol device {
}
protocol kernel kernel4 {
        ipv4 {
                export all;
        };
}
protocol direct {
        ipv4;
        interface "eth0" , "eth1" , "eth2" ;
}
protocol static static4 {
        ipv4;
        route 192.168.1.0/24 via 172.16.1.1;
}

Restart BIRD

# BIRD appliance di GNS3
# killall bird6
# /usr/local/sbin/bird6 -u gns3 -g staff &
# BIRD di OpenWRT
killall zebra
killall bgpd
killall watchquagga
killall ospfd
killall ospf6d
killall ripd
killall ripngd
killall bird
bird

Cek

jalankan di shell

birdc

ketik

show interfaces
show static
show protocols
show protocols all static4
show route

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