LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2014, 10:39 AM   #1
donglee
LQ Newbie
 
Registered: Jan 2014
Posts: 9

Rep: Reputation: Disabled
Cisco and Linux and Vlans


I appear to have some fundamental misunderstanding of how VLANs work on Linux, and I'm hoping the good people here can educate me.

Cast: One Cisco WS-C3560X-24T-L, one VLAN, and one Linux box [1].

Cisco --------------- Linux
ge0/1 eth0
The Cisco has a Vlan 37 interface, with IP address 10.40.37.252/24. I want to place 10.40.37.1/24 on the Linux box.

When the Cisco de-encapsulates vlan 37, everything works fine [2]:

# Cisco
interface Vlan37
ip address 10.40.37.252/24

interface GigabitEthernet 0/1
switchport mode access
switchport access vlan 37

# Linux
ip link set eth0 up
ip addr add 10.40.37.1/24 dev eth0

$ ping 10.40.37.252 && echo It works
However, when I set the port to trunking and assign vlan 37 on the Linux side, it stops working:

# Cisco
interface GigabitEthernet 0/1
switchport trunk encapsulation dot1q
switchport mode trunk
! [3] [4] [7]

# Linux
vconfig add eth0 37
ip link set eth0.37 up
ifconfig eth0 0.0.0.0 up # ensure no address
ip addr add 10.40.37.1/24 dev eth0.37

$ ping 10.40.37.252 || echo Why does this not work
What am I missing here?

Last edited by donglee; 03-16-2014 at 09:53 PM.
 
Old 03-15-2014, 10:57 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,348

Rep: Reputation: Disabled
You may be missing the native VLAN on the trunk port. Packets from the native VLAN won't be encapsulated, even if the port is manually configured as a trunk. Other than that, your configuration seems correct, and should work.

Please note that when you change the operating mode of the interface on the switch, Spanning Tree has to go through that whole "listening - Learning - forwarding" process again. It can take up to 30 seconds before the link is operational.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CentOS VLANs and Cisco Catalyst switch (router on stick problem) Grejeru Linux - Networking 4 07-28-2011 03:08 PM
Vlans with ClearOS adn Cisco 3560G Layer 3 Switch hladamjr Linux - Networking 0 11-08-2010 10:11 AM
LXer: What is Cisco Doing with Linux? Cisco execs tell all! LXer Syndicated Linux News 0 02-27-2009 08:10 AM
LXer: Run Linux on your Cisco router with Cisco's new AXP module LXer Syndicated Linux News 0 10-03-2008 03:00 PM
Redhat and Cisco VLANs Dexx Linux - Networking 1 07-18-2006 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration