Virtual Router JUNOS

From Teknologisk videncenter
Jump to: navigation, search

Beskrivelse

Virtual Routers bruges på Juniper Udstyr til at lave total adskildte netværk inden i den samme kasse[1]. Det er en af de forkskellige typer af Routing Instance JUNOS understøtter.
I de forskellige Virtuelle routere vil routnings tabel, interfaces og tabeller være helt adskidlte.

Følgende skal konfigureres for at bruge virtuelle routere:

  1. Opret en virtuel router
  2. Tildel interfaces til den virtuelle router
  3. Konfigurer routing options for den virtuelle router(optional)

Setup

Følgende setup blive konfigureret med RIP:

Setup

Alle routere er virtuelle og forbindes med logiske interfaces

Opret virtuel router

Her oprettes et routing instance af typen virtual router

[edit]
rael@SRX240# <input>set routing-instances P1 instance-type virtual-router</input>

[edit]
rael@SRX240#

Tildel interfaces

Her tildeles 2 logiske tunnel interfaces til routeren P1

[edit routing-instances P1]
rael@SRX240# <input>set interface lt0/0/0.1</input>

[edit routing-instances P1]
rael@SRX240# <input>set interface lt0/0/0.2</input>

Verificer Konfiguration

P2 er også oprettet og P1 pringer P2 for at kontrollere forbindelserne

[edit routing-instances P1]
rael@SRX240# show
instance-type virtual-router;
interface lt-0/0/0.1;
interface lt-0/0/0.2;

[edit routing-instances P1]
rael@SRX240# <input>commit and-quit</input>
commit complete
Exiting configuration mode

rael@SRX240> <input>show route table P1.inet.0</input>

P1.inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.0/30        *[Direct/0] 00:01:02
                    > via lt-0/0/0.1
10.0.0.1/32        *[Local/0] 00:01:02
                      Local via lt-0/0/0.1
10.0.0.8/30        *[Direct/0] 00:01:02
                    > via lt-0/0/0.10
10.0.0.10/32       *[Local/0] 00:01:02
                      Local via lt-0/0/0.10

rael@SRX240> <input>ping routing-instance P1 10.0.0.1</input>
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=0.817 ms
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.497 ms
<input>^C</input>
--- 10.0.0.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.497/0.657/0.817/0.160 ms

rael@SRX240> <input>ping routing-instance P1 10.0.0.2</input>
PING 10.0.0.2 (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: icmp_seq=0 ttl=64 time=24.933 ms
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=1.088 ms
<input>^C</input>
--- 10.0.0.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.088/13.011/24.933/11.923 ms

Routing Options/Protocols

Routing protokoller konfigureres under hvert routing-instance og import/export regler ligger globalt på udstyret og refereres til fra hver instance. Øger genbruget.
Her bruges RIP som i dette eksempel.

[edit routing-instances P1 protocols]
rael@SRX240# <input>show</input>
rip {
    send multicast;
    receive version-2;
    group RIP-GR {
        export RIP-EXPORT;
        neighbor lt-0/0/0.1;
        neighbor lt-0/0/0.10;
    }
}

Export policy:

[edit]
rael@SRX240# <input>show policy-options</input>
policy-statement RIP-EXPORT {
    term 1 {
        from protocol [ direct rip ];
        then accept;
    }
}

Hvis alt virker kan vi se alle netværk i alle routing instances

rael@SRX240> <input>show route table P1.inet.0</input>

P1.inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.0/30        *[Direct/0] 00:51:51
                    > via lt-0/0/0.1
10.0.0.1/32        *[Local/0] 00:57:06
                      Local via lt-0/0/0.1
10.0.0.4/30        *[RIP/100] 00:09:03, metric 2, tag 0
                    > to 10.0.0.2 via lt-0/0/0.1
10.0.0.8/30        *[Direct/0] 00:51:51
                    > via lt-0/0/0.10
10.0.0.10/32       *[Local/0] 00:57:06
                      Local via lt-0/0/0.10
10.0.0.12/30       *[RIP/100] 00:09:04, metric 2, tag 0
                    > to 10.0.0.9 via lt-0/0/0.10
10.1.0.0/24        *[Direct/0] 00:09:02
                    > via lo0.1
10.1.0.1/32        *[Local/0] 00:09:02
                      Local via lo0.1
10.2.0.0/24        *[RIP/100] 00:08:58, metric 2, tag 0
                    > to 10.0.0.2 via lt-0/0/0.1
10.3.0.0/24        *[RIP/100] 00:08:58, metric 2, tag 0
                    > to 10.0.0.9 via lt-0/0/0.10
10.4.0.0/24        *[RIP/100] 00:00:18, metric 3, tag 0
                    > to 10.0.0.2 via lt-0/0/0.1
                      to 10.0.0.9 via lt-0/0/0.10
224.0.0.9/32       *[RIP/100] 00:00:22, metric 1
                      MultiRecv

Referencer