CentOS Box And Cisco 3750 VLAN’s

Home » CentOS » CentOS Box And Cisco 3750 VLAN’s
CentOS 7 Comments

Hello all,

I have a CentOS box that has a NIC (eth0) on which I defined 4 VLAN‘s
(counting the NIC itself): eth0, eth0.1, eth0.2 and eht0.3. Initially the Cisco switch was not partitioned into VLAN’s which means that the only VLAN
running on it was the default one (VLAN 1).

I have then played with VLAN’s a bit on the switch and at this point have two: VLAN 1 (which is default and can not be deleted) and VLAN 3. The CentOS box is plugged into a trunk port on VLAN 3 which by virtue of being a trunk should belong to all VLANs. However, this does not seem to work as expected.

What I get is the following:

1) eht0 does not come up at all.

ifup eth0
Device eth0 does not seem to be present, delaying initialization

2) eth0.3 comes up fine.

3) Other VLAN’s do not come up. No error messages, just never show up.

Any insight into this would be most welcome. Primarily, I fail to understand why all those VLAN’s came up on VLAN 1 and why now even VLAN 1
does not come up – even though the trunk port the device is plugged into is supposed to be a member of all VLAN’s.

Thanks in advance.

Boris.

7 thoughts on - CentOS Box And Cisco 3750 VLAN’s

  • —– “Boris Epstein” escreveu:

    Hi Boris,

    Well, can you send to us the result of the “show run interface” on the switch interface? Maybe seeing the switch configuration we can help :D

    On the VLAN1 matter, you cannot “disabled” it. But, you can shut it down, and can restrict the access to it on that port. If it was needed. :D

    Thanks,

    Antonio.


    Antonio da Silva Martins Jr. Analista de Suporte NPD – Núcleo de Processamento de Dados UEM – Universidade Estadual de Maringá
    email: asmartins@uem.br fone: +55 (44) 3011-4015 / 3011-4411
    inoc-dba: 263076*100

    “Real Programmers don’t need comments — the code is obvious.”


    Esta mensagem foi verificada pelo sistema de antivirus e acredita-se estar livre de perigo.

  • I take eth0 is then an untagged vlan?

    Actually you can make the default vlan be someone else. And, risking going on a tangent, it is a good idea not leaving vlan1 as the default one in a cisco device. Also, just to be sure, this vlan is tagged in this trunk port in the cisco side, right?

    How are you bringing them up: network manager or not? Do dmesg and the logs show anything interesting?

    Do the interfaces show up?

    This is how the vlans I defined one of my CentOS boxes to know (more like act like they care) of:

    cat /proc/net/vlan/config VLAN Dev name | VLAN ID
    Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
    eth0.10 | 10 | eth0
    eth0.2 | 2 | eth0
    eth0.3 | 3 | eth0
    eth0.4 | 4 | eth0
    eth0.8 | 8 | eth0

    Not trying to second guess you, but here is what a trunk I defined in a cisco switch looks like:

    !
    interface FastEthernet0/2
    description 802.1Q Trunk to vmhost switchport trunk encapsulation dot1q switchport trunk native vlan 2
    switchport trunk allowed vlan 1-15,1002-1005
    switchport mode trunk
    !

  • Boris, I’d suggest reviewing the guide from Redhat on configuring your server
    (https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces_802.1q-vlan-tagging.html)

    In essence, eth0 is a shell. eth0.x is where all the traffic happens. VLANs will need to be explicitly defined on both the server and the switch in order for traffic to pass. Again, follow the RedHat guide for the server configuration. Be sure to set the interface filename and the device name inside the file to match the VLAN ID you’re using. For example, VLAN 1 will be /etc/sysconfig/network-scripts/ifcfg-eth0.1 and the first line of the file should be DEVICE=eth0.1. VLAN 2 should use ifcfg-eth0.2 and DEVICE=eth0.2. It’s easy to forget to update the DEVICE
    field inside the file and conflict with another device on the system so double check all work.

    On the Cisco switch, define the VLANs:
    … repeat for each VLAN

    And configure the ports:
    … repeat for other trunk ports. I’d also recommend turning off VTP and setting all non-trunk ports to access mode
    (http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3750x_3560x/software/release/12-2_55_se/configuration/guide/3750xscg/swvlan.html#wp1150876).

    –Blake

    Boris Epstein wrote the following on 5/30/2014 2:59 PM:

  • The sub-interface files should also have:
    VLAN=yes

    Don’t forget:
    switchport trunk encapsulation dot1q for interoperation with non-cisco stuff.

    Also note that you can assign the IP for the untagged vlan (default 1
    on the cisco) to the eth0 interface instead of having an eth0.1
    subinterface. I’d guess that the problem with the interfaces not coming up has to do with the DEVICE= names being wrong. They should come up OK (but not actually work) even if there is a mismatch at the other end.

  • Hello everyone,

    Thanks for thoughtful and thorough advice. No luck so far, though.

    I have two VLAN’s now – 0003 and 0004, named “vlan3” and “vlan4”
    respectively – and still for some reason the CentOS fails to recognize them as one would expect. So I am puzzled as to what is still missing from the picture? Could the NIC itself (the hardware) introduce some undesired weirdness into the picture?

    Thanks.

    Boris.

  • You haven’t given enough info for anyone to help. Can you post your ifcfg-eth0 and ifcfg-eth0.3 files along with the error messages you see if there are any?

  • Les and everyone,

    Thanks!

    I have just redone the whole setup and discovered the following: the problem appears to have been on the Cisco side all along. The default
    (natiive) VLAN on the trunk port was set to VLAN 3. Apparently, it had to be set to VLAN 1.