Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Config files for multiple IP's on VLANs

  1. #1

    Default Config files for multiple IP's on VLANs

    How can you do it with individual ifcfg-* files?

    I've tried adding them like this:

    Filename: ifcfg-vlan1:0
    BOOTPROTO='static'
    ETHERDEVICE='vlan1'
    STARTMODE='manual'
    USERCONTROL='no'
    IPADDR='192.168.1.2/24'

    but it fails on ifup, thinking it might be the filename (the vlan tagging being picked up from the name) I tried renaming it but still no go.

    I can add IP's via ifconfig, eg
    ifconfig vlan1:0 192.168.1.2 netmask 255.255.255.0 up

    and I'm pretty sure I could add multiples to the ifcfg-vlan1 file but how do I add them from individual config files?

    Thanks

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Config files for multiple IP's on VLANs

    There might be something useful for you in this thread.

    OS 11.4 network manager default connection can handle virtual interfaces?

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3

    Default Re: Config files for multiple IP's on VLANs

    No, essentially that's suggesting to do the same as I've already tried, ie adding a config file for ifcfg-<interface>.0
    It just doesn't work when DEVICE (or ETHERDEVICE) is a vlan
    If I specify DEVICE as vlan1:1 or vlan1 I get
    Interface vlan1:1 is not available
    If I try with ETHERDEVICE=vlan1 I get
    vlan1:1
    ERROR: trying to add VLAN #1 to IF -:vlan1:- error: File exists
    If I try with ETHERDEVICE=vlan1.1 I get

    vlan1:1
    ERROR: vlan interface is same with ethernet interface

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Config files for multiple IP's on VLANs

    I don't see how ETHERDEVICE could be anything but a real interface, the way VLANs work.

  5. #5

    Default Re: Config files for multiple IP's on VLANs

    I was trying anything by that point! :-)

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Config files for multiple IP's on VLANs

    I don't think you can have a hierarchy of VLANs. The VLAN ID is just a 12 bit field in the frame.

    I think you may be confusing VLANs with interface aliases. If you had wanted aliases the old syntax of eth0:1 and so forth is no longer needed, because you can bind multiple IPs to a real interface without an alias. If you really want a VLAN interface, have a look at man ifcfg-vlan.

  7. #7

    Default Re: Config files for multiple IP's on VLANs

    I know that but AIUI you have to specify all the IP's in the same config file which means you can't (easily) bring down individual IP's.

    I want to be able to do

    ifup vlan1.0

    and it brings up a second IP address on vlan1

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Config files for multiple IP's on VLANs

    Doesn't the third example in man 5 ifcfg-vlan do what you want? Then you run ifup lan1 eth0.

  9. #9

    Default Re: Config files for multiple IP's on VLANs

    No, that's just for a single IP vlan.

  10. #10
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Config files for multiple IP's on VLANs

    As I understand the man page, you just create other files lan2, lan3, lan4, etc all referring to the same VLAN, since the VLAN ID is specified in one of the lines. Nowhere is it said that you can have only one file per VLAN.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •