# 11) MPLS

![Начальная схема сети](https://1953625668-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFMJhMiVjTLWfbfC-S4%2F-MVztNStzRsukXCnn09Z%2F-MW-5tKICvWAEQpEamdR%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media\&token=ab23ec24-6297-4cf8-b246-093e7f1de676)

| 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 разворачивать пока не стоит.

![](https://1953625668-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFMJhMiVjTLWfbfC-S4%2F-MYyS3qT-q5cvGpWosvG%2F-MYyY-eTROk2oETRuMga%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png?alt=media\&token=515a79b1-c62d-4d04-a415-d2761d3d2745)

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

{% 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 %}
