
Доступно с версии EasyWRT 
Заводская конфигурация и структура объектов Layer2Bridging
Layer2Bridging определяет способ настройки портов CPE для работы с тегированными кадрами.
По умолчанию структура объектов Layer2Bridging для 5ти портового роутера (1 WAN, 4 LAN) содержит в себе 12 объектов:
- 5 объектов AvailableInterface
- 2 объекта Bridge
- 5 объектов Filter
Подробнее о стандартных объектах Layer2Bridging:

Схема в заводской конфигурации 
|
Web UI 
|
|
AvailableInterfaceInternetGatewayDevice.Layer2Bridging.AvailableInterface.{i}
InternetGatewayDevice.Layer2Bridging.AvailableInterface.{i}.AvailableInterfaceKey
InternetGatewayDevice.Layer2Bridging.AvailableInterface.{i}.InterfaceReference
InternetGatewayDevice.Layer2Bridging.AvailableInterface.{i}.InterfaceType |
Объекты AvailableInterface содержат в себе информацию о доступных интерфейсах на роутере, которые могут быть добавлены во VLAN. Ключевым параметр - AvailableInterfaceKey, является уникальным номером интерфейса и используется для связи с другими объектами. Эти объекты являются константными и недоступны для редактирования. |
|
|
BridgeInternetGatewayDevice.Layer2Bridging.Bridge.{i}
InternetGatewayDevice.Layer2Bridging.Bridge.{i}.BridgeKey
InternetGatewayDevice.Layer2Bridging.Bridge.{i}.BridgeName
InternetGatewayDevice.Layer2Bridging.Bridge.{i}.BridgeStandard
InternetGatewayDevice.Layer2Bridging.Bridge.{i}.BridgeEnable
InternetGatewayDevice.Layer2Bridging.Bridge.{i}.VLANID |
Объекты Bridge служат для создания VLAN на роутере, с указанием для него VLAN ID. ## Bridge объект для сегмента LAN
"Bridge.1" : {
"Bridge.1.BridgeKey" : 1,
"Bridge.1.BridgeName" : "lan",
"Bridge.1.BridgeStandard" : "802.1D",
"Bridge.1.BridgeEnable" : true,
"Bridge.1.VLANID" : 0
}
## Bridge объект для сегмента WAN
"Bridge.2" : {
"Bridge.2.BridgeKey" : 2,
"Bridge.2.BridgeName" : "wan",
"Bridge.2.BridgeStandard" : "802.1D",
"Bridge.2.BridgeEnable" : true,
"Bridge.2.VLANID" : 0
} |
|
|
FilterInternetGatewayDevice.Layer2Bridging.Filter.{i}
InternetGatewayDevice.Layer2Bridging.Filter.{i}.AdmitOnlyVLANTagged
InternetGatewayDevice.Layer2Bridging.Filter.{i}.FilterBridgeReference
InternetGatewayDevice.Layer2Bridging.Filter.{i}.FilterEnable
InternetGatewayDevice.Layer2Bridging.Filter.{i}.FilterInterface
InternetGatewayDevice.Layer2Bridging.Filter.{i}.FilterKey
InternetGatewayDevice.Layer2Bridging.Filter.{i}.FilterStatus
InternetGatewayDevice.Layer2Bridging.Filter.{i}.VLANIDFilter |
Объекты Filter служат для добавления интерфейса во VLAN и за поведение входящего трафика на данный интерфейс. ##Filter объект для связи порта LAN1 c Bridge.1
"Filter.1" : {
"Filter.1.AdmitOnlyVLANTagged" : false,
"Filter.1.FilterBridgeReference" : 1,
"Filter.1.FilterEnable" : true,
"Filter.1.FilterInterface" : 11,
"Filter.1.FilterKey" : 1,
"Filter.1.FilterStatus" : "Enabled",
"Filter.1.VLANIDFilter" : -1
}
##Filter объект для связи порта LAN2 c Bridge.1
"Filter.2" : {
"Filter.2.AdmitOnlyVLANTagged" : false,
"Filter.2.FilterBridgeReference" : 1,
"Filter.2.FilterEnable" : true,
"Filter.2.FilterInterface" : 12,
"Filter.2.FilterKey" : 2,
"Filter.2.FilterStatus" : "Enabled",
"Filter.2.VLANIDFilter" : -1
}
##Filter объект для связи порта LAN3 c Bridge.1
"Filter.3" : {
"Filter.3.AdmitOnlyVLANTagged" : false,
"Filter.3.FilterBridgeReference" : 1,
"Filter.3.FilterEnable" : true,
"Filter.3.FilterInterface" : 13,
"Filter.3.FilterKey" : 3,
"Filter.3.FilterStatus" : "Enabled",
"Filter.3.VLANIDFilter" : -1
}
##Filter объект для связи порта LAN4 c Bridge.1
"Filter.4" : {
"Filter.4.AdmitOnlyVLANTagged" : false,
"Filter.4.FilterBridgeReference" : 1,
"Filter.4.FilterEnable" : true,
"Filter.4.FilterInterface" : 14,
"Filter.4.FilterKey" : 4,
"Filter.4.FilterStatus" : "Enabled",
"Filter.4.VLANIDFilter" : -1
}
##Filter объект для связи порта WAN c Bridge.2
"Filter.5" : {
"Filter.5.AdmitOnlyVLANTagged" : false,
"Filter.5.FilterBridgeReference" : 2,
"Filter.5.FilterEnable" : true,
"Filter.5.FilterInterface" : 0,
"Filter.5.FilterKey" : 5,
"Filter.5.FilterStatus" : "Enabled",
"Filter.5.VLANIDFilter" : -1
} |
|
|
MarkingInternetGatewayDevice.Layer2Bridging.Marking.{i}
InternetGatewayDevice.Layer2Bridging.Marking.{i}.EthernetPriorityMark
InternetGatewayDevice.Layer2Bridging.Marking.{i}.MarkingBridgeReference
InternetGatewayDevice.Layer2Bridging.Marking.{i}.MarkingEnable
InternetGatewayDevice.Layer2Bridging.Marking.{i}.MarkingInterface
InternetGatewayDevice.Layer2Bridging.Marking.{i}.VLANIDMark
InternetGatewayDevice.Layer2Bridging.Marking.{i}.VLANIDUntag |
Объекты Marking служат для определения поведения выходящего трафика с интерфейса добавленного во VLAN. По умолчанию объекты Marking отсутствуют, т.к. два объекта Bridge находятся в режиме 802.1D, а не 802.1Q. |
|
|
Примеры настройки VLAN
Рассмотрим два примера настройки:

Настройка LAN в режиме Bridge
Настройка "прозрачного моста" позволяет добавить LAN-порт, находящийся за NAT, в один широковещательный домен с WAN-портом.
Схема настраиваемого Bridge 
|
Web UI 
|
|
Изменение объекта Filter для LAN3 и LAN4
InternetGatewayDevice.Layer2Bridging.Filter.{i}.
"Filter.3" : {
"Filter.3.AdmitOnlyVLANTagged" : false,
"Filter.3.FilterBridgeReference" : 2,
"Filter.3.FilterEnable" : true,
"Filter.3.FilterInterface" : 13,
"Filter.3.FilterKey" : 3,
"Filter.3.FilterStatus" : "Disabled",
"Filter.3.VLANIDFilter" : -1
} |
|
|
"Filter.4" : {
"Filter.4.AdmitOnlyVLANTagged" : false,
"Filter.4.FilterBridgeReference" : 2,
"Filter.4.FilterEnable" : true,
"Filter.4.FilterInterface" : 14,
"Filter.4.FilterKey" : 4,
"Filter.4.FilterStatus" : "Disabled",
"Filter.4.VLANIDFilter" : -1
} |
|
|
Как итог, LAN3 и LAN4 добавлены в один "прозрачный мост"/широковещательный домен с WAN портом.
Настройка LAN VLAN
В примере рассматривается добавление порта LAN3 в VLAN100 и порта LAN4 в VLAN200.
Необходимые действия:

Схема настраиваемого LAN VLAN 
|
Web UI 
|
|
Создание и изменение объекта Bridge
InternetGatewayDevice.Layer2Bridging.Bridge.{i}.
Для создания VLAN 100 на роутере, создаем новый объект Bridge и меняем значения по умолчанию у параметров:
- BridgeStandard = 802.1Q
- BridgeEnable = true
- VLANID = 100
Номер и BridgeKey объекта будут одинаковыми, их значения всегда будут n + 1, где n это текущее количество объектов Bridge.
"Bridge.3" : {
"Bridge.3.BridgeKey" : 3,
"Bridge.3.BridgeName" : "",
"Bridge.3.BridgeStandard" : "802.1Q",
"Bridge.3.BridgeEnable" : true,
"Bridge.3.VLANID" : 100
} |
|
|
Для создания VLAN 200 выполняем аналогичные действия:
"Bridge.4" : {
"Bridge.4.BridgeKey" : 4,
"Bridge.4.BridgeName" : "",
"Bridge.4.BridgeStandard" : "802.1Q",
"Bridge.4.BridgeEnable" : true,
"Bridge.4.VLANID" : 200
} |
|
|
Создание и изменение объекта Filter
InternetGatewayDevice.Layer2Bridging.Filter.{i}.
Создаем новый объект Filter и меняем значения параметров:
- FilterBridgeReference = 3
- FilterEnable = true
FilterInterface = 0
В параметре FilterInterface указывается номер интерфейса из параметра AvailableInterfaceKey, в данном примере это номер порта WAN.
Этот интерфейс будет добавлен в Bridge(vlan), значение которого указано в параметре FilterBridgeReference, в этом примере - в Bridge VLAN100.
"Filter.6" : {
"Filter.6.AdmitOnlyVLANTagged" : false,
"Filter.6.FilterBridgeReference" : 3,
"Filter.6.FilterEnable" : true,
"Filter.6.FilterInterface" : 0,
"Filter.6.FilterKey" : 6,
"Filter.6.FilterStatus" : "Disabled",
"Filter.6.VLANIDFilter" : -1
} |
|
|
Для перевода LAN 3 в ранее созданный Bridge.3 из существующего по умолчанию Bridge.1, изменим значение параметра FilterBridgeReference в объекте Filter.3 на "3":
"Filter.3" : {
"Filter.3.AdmitOnlyVLANTagged" : false,
"Filter.3.FilterBridgeReference" : 3,
"Filter.3.FilterEnable" : true,
"Filter.3.FilterInterface" : 13,
"Filter.3.FilterKey" : 3,
"Filter.3.FilterStatus" : "Disabled",
"Filter.3.VLANIDFilter" : -1
} |
|
|
Аналогично LAN3, для LAN 4 создается новый объект Filter, добавляющий WAN в Bridge VLAN200:
"Filter.7" : {
"Filter.7.AdmitOnlyVLANTagged" : false,
"Filter.7.FilterBridgeReference" : 4,
"Filter.7.FilterEnable" : true,
"Filter.7.FilterInterface" : 0,
"Filter.7.FilterKey" : 7,
"Filter.7.FilterStatus" : "Disabled",
"Filter.7.VLANIDFilter" : -1
} |
|
|
Для добавления LAN 4 в Bridge VLAN200, в объекте Filter.4 изменяется параметр FilterBridgeReference на "4":
"Filter.4" : {
"Filter.4.AdmitOnlyVLANTagged" : false,
"Filter.4.FilterBridgeReference" : 4,
"Filter.4.FilterEnable" : true,
"Filter.4.FilterInterface" : 14,
"Filter.4.FilterKey" : 4,
"Filter.4.FilterStatus" : "Disabled",
"Filter.4.VLANIDFilter" : -1
} |
|
|
Создание и изменение объекта Marking
InternetGatewayDevice.Layer2Bridging.Marking.{i}.
Создаем новый объект Marking и изменяем значения для:
- MarkingBridgeReference = 3
- MarkingEnable = true
- MarkingInterface = 13
- VLANIDUntag = true
В MarkingBridgeReference указывается номер объекта Bridge, с которым работает данный объект Marking, в примере это "3" для Bridge VLAN100.
В MarkingInterface указывается номер интерфейса, с которым работает данный объект Marking. Значение берется из параметра AvailableInterfaceKey, в примере это "13" для порта LAN3.
В VLANIDUntag указывается значение true или false. При значении true кадры будут выходить с порта LAN3 нетегированными, при значении false тегированными, в нашем примере с VLANID 100.
"Marking.1" : {
"Marking.1.EthernetPriorityMark" : -1,
"Marking.1.MarkingBridgeReference" : 3,
"Marking.1.MarkingEnable" : true,
"Marking.1.MarkingInterface" : 13,
"Marking.1.VLANIDMark" : -1,
"Marking.1.VLANIDUntag" : true
} |
|
|
Аналогичным образом создаем объект Marking для порта LAN3 в VLAN200:
"Marking.2" : {
"Marking.2.EthernetPriorityMark" : -1,
"Marking.2.MarkingBridgeReference" : 4,
"Marking.2.MarkingEnable" : true,
"Marking.2.MarkingInterface" : 14,
"Marking.2.VLANIDMark" : -1,
"Marking.2.VLANIDUntag" : true
} |
|
|