Floating static route

IPv4 floating static route konfigureras i den globala konfigurationsläget med kommandot ip route och explicit administrativ distans. Om i kommandot anges inte den explicita administrativa distansen IOS använder värdet 1 som default.  Den administrativa distansen för direkt anslutna nätverk är noll och ett för standard statiska route.

Studera en stund topologin nedan. Här föredrar router R1 använda länken till R2 och inte länken till R3. Anslutningen till R3 ska endast användas för reserv/backup.

Bild 1: Floating static route

R1 är konfigurerad med en standard static route som pekar mot R2. Eftersom inget administrativt avstånd har konfigurerats används standardvärdet (1). R1 är också konfigurerad med en floating static route som pekar på R3 med ett administrativt avstånd på 5. Detta värde är större än standardvärdet 1 och därför betraktas denna route som reserv. En sådan route registreras inte i routing-tabellen, men den finns och görs synlig när den favorit route inte längre fungerar.

Konfigurationer

  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R1
  • R1(config)# int g0/0
  • R1(config-if)# ip address 172.16.3.1 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# int s0/0/0
  • R1(config-if)# clock rate 128000
  • R1(config-if)# ip address 172.16.2.1 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# int s0/0/1
  • R1(config-if)# clock rate 128000
  • R1(config-if)# ip address 10.10.10.1 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# exit
  • R1(config)# ip route 0.0.0.0  0.0.0.0  172.16.2.2
  • Floating static route
  • R1(config)# ip route 0.0.0.0  0.0.0.0  10.10.10.2  5
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R2
  • R1(config)# int g0/0
  • R1(config-if)# ip address 172.16.1.1  255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# int s0/0/0
  • R1(config-if)# ip address 172.16.2.2  255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# int s0/0/1
  • R1(config-if)# clock rate 128000
  • R1(config-if)# ip address 192.168.1.1  255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# exit
  • Standard static route
  • R1(config)# ip route 172.16.3.0 255.255.255.0 172.16.2.1
  • R1(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.1
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R3
  • R1(config)# int g0/0
  • R1(config-if)# ip address 192.168.2.1 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# int s0/0/1
  • R1(config-if)# ip address 192.168.1.1 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# int s0/0/0
  • R1(config-if)# ip address 10.10.10.2 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# exit
  • R1(config)# ip route 0.0.0.0  0.0.0.0 192.168.1.2
  • Floating static route
  • R1(config)# ip route 0.0.0.0  0.0.0.0  10.10.10.1  5

Från PC1 exekvera tracert 192.168.2.10 (PC3)

Nätverkstrafiken dirigeras från R1 till R2.

 

R1 och R3 har en floating static route som inte syns i routrarnas routing-tabeller. Dessa route träder i kraft när R2 inte längre är tillgänglig. För att simulera detta ska interfacen på R2 stängas av:

  • R2(config)# interface 0/0/0
  • R2(config-if)# shutdown
  • R2(config-if)# interface 0/0/1
  • R2(config-if)# shutdown

Exekvera nu tracert 192.168.2.10 från PC1.


Nätverkstrafiken går nu genom R3!