Saturday, September 23, 2023
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 10039  / 2 Years ago, fri, november 26, 2021, 8:26:03

I'm not sure about the syntax here: what comes first in /etc/network/interfaces interface names, VLAN or alias? What I want is to setup two different subnets on the same VLAN (temporarily).



It will look something like below, where there's a 10.20.100.100/24 and 10.20.200.200/24 on the same VLAN (id 33):



iface eth0:1.33 inet static
address 10.20.100.100
netmask 255.255.255.0

iface eth0:2.33 inet static
address 10.20.200.200
netmask 255.255.255.0


I expected the Debian Wiki to answer this but it did not: https://wiki.debian.org/NetworkConfiguration#Multiple_IP_addresses_on_One_Interface


More From » networking

 Answers
5

I don't know when and what changed, but you can now define virtual interfaces on vlans:



auto eth0.10
iface eth0.10 inet static
address 192.168.1.61
netmask 255.255.255.0
gateway 192.168.1.11

auto eth0.10:1
iface eth0.10:1 inet static
address 10.20.100.100
netmask 255.255.255.0

auto eth0.10:2
iface eth0.10:2 inet static
address 10.20.100.200
netmask 255.255.255.0


Think of vlan interfaces as physical interfaces. You add virtual interfaces to the "physical" interface.


[#27988] Saturday, November 27, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oraoming

Total Points: 354
Total Questions: 105
Total Answers: 124

Location: Iraq
Member since Sat, Apr 3, 2021
3 Years ago
oraoming questions
Fri, Aug 20, 21, 10:08, 2 Years ago
Mon, May 24, 21, 21:56, 2 Years ago
Mon, Dec 12, 22, 23:21, 10 Months ago
Mon, Sep 12, 22, 11:38, 1 Year ago
;