Debian VLAN beállítás

Fórumok

Sziasztok!

Debian Etch-et próbálok VLAN-t beállítani.

Parancssorból megy, először felhúzom a fizikai interface-t, IP nélkül:

ifconfig eth0 up

majd hozzáadom a VLAN-okat:

vconfig add eth0.1
vconfig add eth0.2

majd pedig ezeket is felhúzom:

ifconfig eth0.1 10.1.2.3 netmask 255.0.0.0
ifconfig eth0.2 1.2.3.4 netmask 255.255.255.0

Ez így szépen működik is, viszont ha a /etc/network/interfaces file-ból próbálom ezt:

auto lo
iface lo inet loopback

auto vlan1 vlan2

iface vlan1 inet static
       address 10.0.0.3
       netmask 255.0.0.0
       vlan_raw_device eth0

iface vlan2 inet static
        address 1.2.3.4
        netmask 255.255.255.0
       network 1.2.3.0
       broadcast 1.2.3.255
       gateway 1.2.3.254
       # dns-* options are implemented by the resolvconf package, if installed
       dns-nameservers 1.2.3.254
       vlan_raw_device eth0

Akkor az 1.2.3.4 IP-vel két interface is feljön, az eth0, és az eth0.2. Ezt nem szeretném, csak az eth0.2-nek legyen 1.2.3.4 az IP-je, az eth0-nak ne legyen, ugyanúgy, ahogyan a parancssori megoldásnál sincs.

Hogyan tudom ezt beállítani?

Petya

Hozzászólások

Igy nem jo?


auto eth0.2  
iface eth0.2 inet static
    pre-up vconfig add eth0 2 || true
    post-down vconfig rem eth0 2 || true
    address 192.168.xx.xx
    netmask 255.255.xx.xx
    broadcast 255.255.xx.xx

#apt-get install vlan

#modprobe 8021q

szerkeszteni /etc/network/interfaces

auto vlan2
iface vlan2 inet static
address 10.0.0.2
netmask 255.255.255.0
gateway 10.0.0.1
vlan_raw_device eth0

Ennyi kell debian alatt.

/etc/network/interfaces

auto eth0 vlan2

iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1

iface vlan2 inet static
address 10.0.0.2
netmask 255.255.255.0
vlan_raw_device eth0

ahol:
eth0 - nativ vlan interface
vlan2 - trunk(cisco)/taggeg(3com) vlan interface

Ha nem akarsz IP-t eth0-ra, akkor csak ennyit szúrj be:

auto eth0
iface eth0 inet manual

Hello!

Köszönöm, működik.

Viszont előjött egy másik probléma:

DHCP szerver is fut a gépen, ami így nem indul el, mert egyrészt nincs az eth0-nak IP címe, de azért a dhcpd várja a dhcp.conf-ba az eth0 subnet-jét. (No subnet declaration for eth0 (0.0.0.0) )

Ha beírom a 0.0.0. subnetet üresen, akkor pedig:

Multiple interfaces match the same subnet, multiple interfaces mathch the same shared network... hol lehet a dhcpd-nek megadni, hogy ignoráljon egy adott interface-t?

Petya