User Tools

Site Tools


linux:vlan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:vlan [2025/10/12 14:09] – created adminlinux:vlan [2025/10/13 11:16] (current) – [Vooraf:] admin
Line 6: Line 6:
 dit document beschrijft hoe je VLANs activeert op linux. dit document beschrijft hoe je VLANs activeert op linux.
  
 +===== Vooraf:=====
 +  * controleer dat de poort waarop je linux hangt, een **trunk** poort is
 +    * fysieke switch: trunk met native VLAN \\ Mative VLAN is de VLAN zonder tagging; doorgaans VLAN 1 tenzij anders geconfigureerd.
 +    * (**ESXi**): **virtuele switch > PortGroup** met: 
 +      * VLAN: **4095**
 +      * Security → Promiscuous Mode → Accept
 +      * MAC address changes → Accept{{ :linux:chatgpt_image_oct_13_2025_11_57_49_am.png?400 |}}\\ 
 +        * REJECT: default behaviour: VM ziet enkel verkeer voor eigen MAC 
 +        * ACCEPT: VM ziet alle verkeer uit de portgroup (dus: alle VLANs) 
 +         
 ===== stappenplan===== ===== stappenplan=====
-  - controleer  +  * log aan op de linux server en voer uit: <code>apt install vlan 
-  - ===== meer info ===== +modprobe 8021q</code> 
-voeg hier linken toe naar verdere uitleg+  * maak een VLAN interface aan <code>ip link add link <nic> name <nic>.<vlanid> type vlan id <vlanid></code> 
 +  * ken een IP adres toe <code>ip addr add <IP>/<mask> dev <nic>.<vlanid></code> 
 +  * breng de interface up: <code>ip link set dev <nic>.<vlanid> up</code> 
 +  * voorbeeld: <code>ip link add link eth0 name eth0.10 type vlan id 10 
 +ip addr add 192.168.10.2/24 dev eth0.10 
 +ip link set dev eth0.10 up 
 +</code> 
 +  * test met **tcpdump**:<code>tcpdump -i <nic>.<vlanid></code> 
 +  * om dit persistent te maken, voeg je dit toe aan ''/etc/network/interfaces'' <code> 
 +auto <nic>.<vlanid> 
 +iface <nic>.<vlanid> inet static 
 +    address <IP> 
 +    netmask 255.255.255.0 
 +    vlan-raw-device <nic> 
 +</code> 
 +  * voorbeeld: <code> 
 +auto eth0.10 
 +iface eth0.10 inet static 
 +    address 192.168.10.2 
 +    netmask 255.255.255.0 
 +    vlan-raw-device eth0 
 +</code> 
 + 
 +===== meer info ===== 
 +[[https://dev.to/s3cloudhub/mastering-vlans-in-linuxunix-a-step-by-step-guide-6hf|Mastering Vlans in Linux/Unix]]
 {{tag>Linux}} {{tag>Linux}}
  
linux/vlan.1760278177.txt.gz · Last modified: by admin