# 2.2) Маршрутизация между VLAN на L3-коммутаторе

Предположим, что у нас есть вот такая топология на L3-коммутаторах с уже настроенными VLANами:

![Схема сети](https://1953625668-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFMJhMiVjTLWfbfC-S4%2F-MLZ0se-WsYP0s0bdmPH%2F-MLZ1M4FMthUywOt0fhp%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=aa3b5b38-b170-405a-88c6-d66deab78f63)

В таком случае можно просто настроить IRB-интерфейсы на центральном маршрутизаторе (SW\.SPB.LIG) и обойтись без маршрутизатора.

Для этого необходимо настроить IRB-интерфейсы:

```
# set interfaces irb unit 10 family inet address 192.168.10.1/24
# set interfaces irb unit 20 family inet address 192.168.20.1/24
# set interfaces irb unit 20 family inet address 192.168.20.1/24
# set interfaces irb unit 5 family inet address 192.168.5.1/24
```

После чего связать VLANы с определёнными IRB-интерфейсами:&#x20;

```
# set vlans 10v l3-interface irb.10    
# set vlans 20v l3-interface irb.20    
# set vlans 30v l3-interface irb.30    
# set vlans default l3-interface irb.5
```

Проверяем работу (видно, что трассировка проходит через IRB.10):

```
VPCS> show 

NAME   IP/MASK              GATEWAY                             GATEWAY
VPCS1  192.168.20.6/24      192.168.20.1
       fe80::250:79ff:fe66:6810/64

VPCS> ping 192.168.10.5

84 bytes from 192.168.10.5 icmp_seq=1 ttl=63 time=406.972 ms
84 bytes from 192.168.10.5 icmp_seq=2 ttl=63 time=105.145 ms
84 bytes from 192.168.10.5 icmp_seq=3 ttl=63 time=105.918 ms
84 bytes from 192.168.10.5 icmp_seq=4 ttl=63 time=106.184 ms
84 bytes from 192.168.10.5 icmp_seq=5 ttl=63 time=104.883 ms​

VPCS> trace 192.168.10.5 -P 1
trace to 192.168.10.5, 8 hops max (ICMP), press Ctrl+C to stop
 1   192.168.20.1   201.283 ms  200.728 ms  201.520 ms
 2   192.168.10.5   406.431 ms  206.481 ms  203.822 ms
```

Полезная ссылка:

[Настройка IRB](https://www.juniper.net/documentation/en_US/junos/topics/topic-map/irb-and-bridging.html)


---

# Agent Instructions: 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/juniper-vlans-+-inter-vlan-routing-+-dhcp/2.1-sozdanie-rvi-na-l3-kommutatore.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.
