User Tools

Site Tools


linux:vlan

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:vlan [2025/10/12 21:08] – [stappenplan] 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.
  
-===== stappenplan=====+===== Vooraf:=====
   * controleer dat de poort waarop je linux hangt, een **trunk** poort is   * controleer dat de poort waarop je linux hangt, een **trunk** poort is
-    * fysieke switch: trunk met native VLAN (s) +    * fysieke switch: trunk met native VLAN \\ Mative VLAN is de VLAN zonder tagging; doorgaans VLAN 1 tenzij anders geconfigureerd. 
-    * virtuele switchPortGroup met VLAN: **4095** (althans in ESXi)+    * (**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=====
   * log aan op de linux server en voer uit: <code>apt install vlan   * log aan op de linux server en voer uit: <code>apt install vlan
-modpobe 8021q</code>+modprobe 8021q</code>
   * maak een VLAN interface aan <code>ip link add link <nic> name <nic>.<vlanid> type vlan id <vlanid></code>   * 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>   * ken een IP adres toe <code>ip addr add <IP>/<mask> dev <nic>.<vlanid></code>
Line 19: Line 26:
 ip link set dev eth0.10 up ip link set dev eth0.10 up
 </code> </code>
 +  * test met **tcpdump**:<code>tcpdump -i <nic>.<vlanid></code>
   * om dit persistent te maken, voeg je dit toe aan ''/etc/network/interfaces'' <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 auto eth0.10
 iface eth0.10 inet static iface eth0.10 inet static
linux/vlan.1760303289.txt.gz · Last modified: by admin