2017-01-20 11:17:20 +01:00
|
|
|
---
|
|
|
|
categories: openbsd network
|
|
|
|
title: Howto VLAN sous OpenBSD
|
|
|
|
---
|
2016-12-29 11:25:39 +01:00
|
|
|
|
2017-05-31 20:22:19 +02:00
|
|
|
* Documentation : <http://man.openbsd.org/vlan.4>
|
2016-12-29 11:25:39 +01:00
|
|
|
|
|
|
|
*IEEE 802.1Q/1AD* encapsulation/decapsulation pseudo-device
|
|
|
|
|
|
|
|
## Création manuelle
|
|
|
|
|
|
|
|
Création de 2 VLANs, 1 et 7, rattachés à l'interface bnx0
|
|
|
|
|
|
|
|
~~~
|
|
|
|
# ifconfig vlan1 create
|
|
|
|
# ifconfig vlan7 create
|
2023-04-27 10:30:38 +02:00
|
|
|
# ifconfig vlan1 vnetid 1 parent bnx0
|
|
|
|
# ifconfig vlan7 vnetid 7 parent bnx0
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
|
|
|
|
|
|
|
On configure ensuite l'interface de la même manière qu'une interface classique :
|
|
|
|
|
|
|
|
~~~
|
2023-04-27 10:30:38 +02:00
|
|
|
# ifconfig vlan1 10.10.10.1/24
|
|
|
|
# ifconfig vlan7 10.20.30.1/24
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
|
|
|
|
|
|
|
## Création définitive
|
|
|
|
|
|
|
|
~~~
|
|
|
|
# cat /etc/hostname.bnx0
|
|
|
|
up
|
2017-01-20 11:17:20 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
# cat /etc/hostname.vlan1
|
2023-04-27 10:30:38 +02:00
|
|
|
vnetid 1 parent bnx0
|
|
|
|
up
|
|
|
|
description "VLAN1-Net1"
|
|
|
|
inet 10.10.10.1/24
|
2017-01-20 11:17:20 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
# cat /etc/hostname.vlan7
|
2023-04-27 10:30:38 +02:00
|
|
|
vnetid 7 parent bnx0
|
|
|
|
up
|
|
|
|
description "VLAN7-Net1"
|
|
|
|
inet 10.20.30.1/24
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|