Lewati ke isi

Routing

Static route dikelola oleh FRR (staticd). FRR menurunkannya ke tabel route kernel, lalu linux-nl menyalinnya ke FIB VPP. Jalur yang sama akan dipakai BGP dan OSPF di versi berikutnya.

Default route

admin@r1# set protocols static route 0.0.0.0/0 next-hop 103.10.20.1
admin@r1# set protocols static route ::/0 next-hop 2001:db8::1
admin@r1# commit

Route ke jaringan lain

admin@r1# set protocols static route 10.30.0.0/24 next-hop 10.0.12.2
admin@r1# set protocols static route 2.2.2.2/32 next-hop 10.0.12.2

Prefix harus berupa alamat jaringan: 10.30.0.0/24 valid, tetapi 10.30.0.5/24 ditolak.

ECMP (beberapa next-hop)

admin@r1# set protocols static route 0.0.0.0/0 next-hop 103.10.20.1
admin@r1# set protocols static route 0.0.0.0/0 next-hop 103.10.30.1

Trafik dibagi ke kedua next-hop per koneksi.

Blackhole

admin@r1# set protocols static route 192.0.2.0/24 blackhole

Paket ke prefix ini dibuang diam-diam. Berguna untuk null route saat serangan, atau untuk agregat yang diumumkan ke BGP. Satu route tidak boleh berisi next-hop dan blackhole sekaligus.

Memeriksa

admin@r1> show ip route        # tabel routing FRR (control plane)
admin@r1> show ip fib          # tabel forwarding di VPP (yang benar-benar dipakai)
admin@r1> show ipv6 route
admin@r1> show ipv6 fib
admin@r1> show vpp ip fib 2.2.2.2/32

Route ada di FRR tapi tidak di VPP?

Cek apakah next-hop bisa dijangkau lewat interface dataplane, lalu periksa show log (linux-nl). Route lewat port management tidak disalin ke VPP.

Contoh dua router

  lo0 1.1.1.1 [R1] eth1 10.0.12.1 ─── 10.0.12.2 eth1 [R2] lo0 2.2.2.2
set interfaces eth1 unit 0 family inet address 10.0.12.1/30
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
set protocols static route 2.2.2.2/32 next-hop 10.0.12.2
set interfaces eth1 unit 0 family inet address 10.0.12.2/30
set interfaces lo0 unit 0 family inet address 2.2.2.2/32
set protocols static route 1.1.1.1/32 next-hop 10.0.12.1

Uji: ping 2.2.2.2 source 1.1.1.1 dari R1.