> For the complete documentation index, see [llms.txt](https://netlabs.gitbook.io/juniper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://netlabs.gitbook.io/juniper/mpls.md).

# 11) MPLS

![Начальная схема сети](/files/-MW-5tKICvWAEQpEamdR)

| Hostname   | LoopBack/NET                          |
| ---------- | ------------------------------------- |
| RT.MSK.M34 | 192.168.0.1/49.0001.1921.6800.0001.00 |
| RT.MSK.M8  | 192.168.0.2/49.0001.1921.6800.0002.00 |
| RT.MSK.M9  | 192.168.0.3/49.0001.1921.6800.0003.00 |
| RT.SPB.STL | 192.168.0.4/49.0001.1921.6800.0004.00 |
| RT.SPB.OBV | 192.168.0.5/49.0001.1921.6800.0005.00 |
| RT.SPB.MIR | 192.168.0.6/49.0001.1921.6800.0006.00 |
| RT.SPB.K12 | 192.168.0.7/49.0001.1921.6800.0007.00 |
| RT.SPB.LNX | 192.168.0.8/49.0001.1921.6800.0008.00 |

Чтобы развернуть MPLS достаточно настроить IP-адресацию и развернуть IS-IS, используя L2.

Также добавим парочку eBGP-пиров. iBGP разворачивать пока не стоит.

![](/files/-MYyY-eTROk2oETRuMga)

Начальные конфигурации:

{% tabs %}
{% tab title="M34" %}

```
system {
    host-name RT.MSK.M34;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.10/31;
            }
            family iso;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.0.4/31;
            }
            family iso;
        }                               
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 40.0.0.3/31;
            }
            family iso;
        }
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 10.0.0.0/31;
            }
            family iso;
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.1/32;
            }
            family iso {                
                address 49.0001.1921.6800.0001.00;
            }
        }
    }
}
routing-options {
    router-id 192.168.0.1;
    autonomous-system 250;
}
protocols {
    bgp {
        export export-BGP;
        group eBGP {
            type external;
            neighbor 40.0.0.2 {
                peer-as 400;
            }
        }
    }
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;             
        }
        interface ge-0/0/1.0 {
            point-to-point;
        }
        interface ge-0/0/3.0 {
            point-to-point;
        }
        interface lo0.0;
    }
}
policy-options {
    policy-statement Next-Hop-Self {
        from protocol bgp;
        then {
            next-hop self;
        }
    }
    policy-statement export-BGP {
        term Aggregate {
            from {
                protocol aggregate;
                route-filter 250.0.0.0/16 exact;
            }                           
            then accept;
        }
        term BGP {
            from protocol bgp;
            then accept;
        }
        then reject;
    }
}
```

{% endtab %}

{% tab title="M8" %}

```
​​​​system {
    host-name RT.MSK.M8;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.11/31;
            }
            family iso;
        }
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 10.0.0.12/31;
            }
            family iso;
        }                               
    }
    ge-0/0/4 {
        unit 0 {
            family inet {
                address 10.0.0.20/31;
            }
            family iso;
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.2/32;
            }
            family iso {
                address 49.0001.1921.6800.0002.00;
            }
        }
    }
}
protocols {
    isis {
        level 1 disable;                
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/2.0 {
            point-to-point;
        }
        interface ge-0/0/4.0 {
            point-to-point;
        }
        interface lo0.0;
    }
}
```

{% endtab %}

{% tab title="M9" %}

```
system {
    host-name RT.MSK.M9;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.6/31;
            }
            family iso;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.0.5/31;
            }
            family iso;
        }                               
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 10.0.0.13/31;
            }
            family iso;
        }
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 10.0.0.14/31;
            }
            family iso;
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.3/32;
            }
            family iso {                
                address 49.0001.1921.6800.0003.00;
            }
        }
    }
}
protocols {
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/1.0 {
            point-to-point;
        }
        interface ge-0/0/2.0 {
            point-to-point;
        }
        interface ge-0/0/3.0 {
            point-to-point;
        }
        interface lo0.0;
    }
}                                       
```

{% endtab %}

{% tab title="STL" %}

```
system {
    host-name RT.SPB.STL;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.7/31;
            }
            family iso;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.0.16/31;
            }
            family iso;
        }                               
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 10.0.0.2/31;
            }
            family iso;
        }
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 10.0.0.1/31;
            }
            family iso;
        }
    }
    ge-0/0/4 {
        unit 0 {
            family inet {
                address 10.0.0.8/31;
            }
            family iso;                 
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.4/32;
            }
            family iso {
                address 49.0001.1921.6800.0004.00;
            }
        }
    }
}
protocols {
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/1.0 {
            point-to-point;
        }
        interface ge-0/0/2.0 {          
            point-to-point;
        }
        interface ge-0/0/3.0 {
            point-to-point;
        }
        interface ge-0/0/4.0 {
            point-to-point;
        }
        interface lo0.0;
    }
}
```

{% endtab %}

{% tab title="OBV" %}

```
system {
    host-name RT.SPB.OBV;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.24/31;
            }
            family iso;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.0.17/31;
            }
            family iso;
        }                               
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 10.0.0.22/31;
            }
            family iso;
        }
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 10.0.0.15/31;
            }
            family iso;
        }
    }
    ge-0/0/4 {
        unit 0 {
            family inet {
                address 10.0.0.21/31;
            }
            family iso;                 
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.5/32;
            }
            family iso {
                address 49.0001.1921.6800.0005.00;
            }
        }
    }
}
protocols {
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/1.0 {
            point-to-point;
        }
        interface ge-0/0/2.0 {          
            point-to-point;
        }
        interface ge-0/0/3.0 {
            point-to-point;
        }
        interface ge-0/0/4.0 {
            point-to-point;
        }
        interface lo0.0;
    }
}
```

{% endtab %}

{% tab title="MIR" %}

```
system {
    host-name RT.SPB.MIR;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.25/31;
            }
            family iso;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.0.26/31;
            }
            family iso;
        }                               
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.6/32;
            }
            family iso {
                address 49.0001.1921.6800.0006.00;
            }
        }
    }
}
protocols {
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/1.0 {
            point-to-point;
        }
        interface lo0.0;
    }                                   
}
```

{% endtab %}

{% tab title="K12" %}

```
system {
    host-name RT.SPB.K12;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.18/31;
            }
            family iso;
        }
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 10.0.0.3/31;
            }
            family iso;
        }                               
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.7/32;
            }
            family iso {
                address 49.0001.1921.6800.0007.00;
            }
        }
    }
}
protocols {
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/2.0 {
            point-to-point;
        }
        interface lo0.0;
    }                                   
}
```

{% endtab %}

{% tab title="LNX" %}

```
system {
    host-name RT.SPB.LNX;
    root-authentication {
        encrypted-password "$1$yjZyno7x$gXQzjRxiaQILDLVjJ2eqz1"; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.0.19/31;
            }
            family iso;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 10.0.0.27/31;
            }
            family iso;
        }                               
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 10.0.0.23/31;
            }
            family iso;
        }
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 60.0.0.1/31;
            }
        }
    }
    ge-0/0/4 {
        unit 0 {
            family inet {
                address 10.0.0.9/31;
            }
            family iso;
        }                               
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.168.0.8/32;
            }
            family iso {
                address 49.0001.1921.6800.0008.00;
            }
        }
    }
}
routing-options {
    router-id 192.168.0.8;
    autonomous-system 250;
}
protocols {
    bgp {
        export export-BGP;
        group eBGP {
            type external;
            neighbor 60.0.0.0 {
                peer-as 600;            
            }
        }
    }
    isis {
        level 1 disable;
        interface ge-0/0/0.0 {
            point-to-point;
        }
        interface ge-0/0/1.0 {
            point-to-point;
        }
        interface ge-0/0/2.0 {
            point-to-point;
        }
        interface ge-0/0/4.0 {
            point-to-point;
        }
        interface lo0.0;
    }
}
policy-options {
    policy-statement Next-Hop-Self {
        from protocol bgp;              
        then {
            next-hop self;
        }
    }
    policy-statement export-BGP {
        term Aggregate {
            from {
                protocol aggregate;
                route-filter 250.0.0.0/16 exact;
            }
            then accept;
        }
        term BGP {
            from protocol bgp;
            then accept;
        }
        then reject;
    }
}
```

{% endtab %}

{% tab title="AS400" %}

```
system {
    host-name AS400;
    root-authentication {
        encrypted-password "$1$WkjAUkd4$d311x1Zg07TkbMyqK7g8P."; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 40.0.0.2/31;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 140.0.0.1/32;
            }                           
        }
    }
}
routing-options {
    aggregate {
        route 140.0.0.0/16;
    }
    autonomous-system 400;
}
protocols {
    bgp {
        export export-BGP;
        group eBGP {
            type external;
            neighbor 40.0.0.3 {
                peer-as 250;
            }
        }
    }
}
policy-options {
    policy-statement export-BGP {
        term Aggregate {
            from {
                protocol aggregate;
                route-filter 140.0.0.0/16 exact;
            }
            then accept;
        }
        term BGP {
            from protocol bgp;
            then accept;
        }
        then reject;
    }
}
```

{% endtab %}

{% tab title="AS600" %}

```
system {
    host-name AS600;
    root-authentication {
        encrypted-password "$1$WkjAUkd4$d311x1Zg07TkbMyqK7g8P."; ## SECRET-DATA
    }
}
interfaces {
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 60.0.0.0/31;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 160.0.0.1/32;
            }                           
        }
    }
}
routing-options {
    aggregate {
        route 160.0.0.0/16;
    }
    autonomous-system 600;
}
protocols {
    bgp {
        export export-BGP;
        group eBGP {
            type external;
            neighbor 60.0.0.1 {
                peer-as 250;
            }
        }
    }
}
policy-options {
    policy-statement export-BGP {
        term Aggregate {
            from {
                protocol aggregate;
                route-filter 160.0.0.0/16 exact;
            }
            then accept;
        }
        term BGP {
            from protocol bgp;
            then accept;
        }
        then reject;
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://netlabs.gitbook.io/juniper/mpls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
