LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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


Closed Thread
  Search this Thread
Old 01-02-2008, 06:49 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Cisco 2924 and Linux


I have a basic understanding of how to create VLAN on a Cisco 2924 switch:

PHP Code:
IP Address for VLAN1

interface VLAN1
 ip address 10.0.0.2 255.255.255.224 
PHP Code:
Enabling the Trunk

interface FastEthernet 0/1
  switchport trunk encapsulation dot1q
  switchport trunk native vlan 1
  switchport mode trunk 
PHP Code:
Moving the Ports

interface FastEthernet0/2
  switchport access vlan 2
interface FastEthernet0/3
  switchport access vlan 2
interface FastEthernet0/4
  switchport access vlan 3
interface FastEthernet0/5
  switchport access vlan 3
interface FastEthernet0/2
  switchport access vlan 3 
I am using Fedora 6. How do I establish the trunk between the firewall and the switch in Linux and also my firewall is doing the DHCP ip assigning so how can I get ip's to my nodes (VLAN1 - Internal, VLAN2 - DMZ devices)?

Last edited by metallica1973; 01-02-2008 at 07:59 PM.
 
Old 01-03-2008, 01:58 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i thought you already had vlan tagging sorted? http://www.candelatech.com/~greear/vlan/howto.html

that'll get the trunked data flowing no problem. as for the dhcp, you need something listening on each interface and forwarding on to the server via a bootp relay, e.g. dhcrelay.
 
Old 01-04-2008, 09:41 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
This is how my vlan is setup on my Cisco 2924 XL switch:

PHP Code:
switch#show vlan                                                                                                                                                 
VLAN Name                             Status    Ports                                                                                                            
---- -------------------------------- --------- -------------------------------                                                                                  
1    default                          active    Fa0/2Fa0/3Fa0/4Fa0/5,                                                                                      
                                                
Fa0/6Fa0/7Fa0/8Fa0/17,                                                                                     
                                                
Fa0/18Fa0/19Fa0/20Fa0/21,                                                                                  
                                                
Fa0/22Fa0/24                                                                                                   
2    VLAN0002                         active    Fa0
/9Fa0/10Fa0/11Fa0/12,                                                                                   
                                                
Fa0/13Fa0/14Fa0/15Fa0/16                                                                                   
1002 fddi
-default                     active                                                                                                                     
1003 token
-ring-default               active                                                                                                                     
1004 fddinet
-default                  active                                                                                                                     
1005 trnet
-default                    active                                                                                                                     
                                                                                                                                                                 
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2                                                                                   
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------                                                                                   
1    enet  100001     1500  -      -      -        -    -        1002   1003                                                                                     
2    enet  100002     1500  
-      -      -        -    -        0      0                                                                                        
1002 fddi  101002     1500  
-      -      -        -    -        1      1003                                                                                     
1003 tr    101003     1500  1005   0      
-        -    srb      1      1002                                                                                     
1004 fdnet 101004     1500  
-      -      1        ibm  -        0      0                                                                                        
1005 trnet 101005     1500  
-      -      1        ibm  -        0      0 
I only want VLAN2 to go to the internet and not be able to talk to VLAN1(management) but I want VLAN1 to be able to talk to anyone. Have I set this up correctly?
 
Old 01-05-2008, 01:45 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well from the config above, the only trunk is to fa0/1, which will pass vlan 1 and vlan 2 as 801.2q and also vlan 1 as native. on the 2900 platforms they only do layer 2, so it's impossible to allow interconnectivity between vlan's on them, as that'd be layer 3, presumably what your linux box is there for?
 
Old 01-05-2008, 10:13 AM   #5
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Exactly, I only have one switch which is the Catalyst 2924 XL and it connects to my Firewall with three nics and everything feeding into this one switch. I have ports FA01 - FA08 for VLAN1 and I have FA09 - FA16 as VLAN2 (DMZ). I have two questions:

1 - As far as security is concerned what is the best way to setup my switch for security? I have very strict firewall rule set and is VLAN sufficient enough?

2 - I have VOIP traffic on my DMZ. How would I setup QOS for voice over data?
 
Old 01-05-2008, 12:50 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
1 - well one big security issue is using vlan 1 ever. ideally you should pick something non-standard, as by default a port will fall onto vlan1, which isn't really a nice state to be in if that's your secret important vlan too... security on those sorts of switches is pretty simple. you have additional clever features you should use like sticky mac for important connections, but most security is about local concerns, not global ones (i.e. internet attacks)

2 - within IOS VOIP should be automatically subjected to appropriate queuing algorithms, but that's a pretty old switch, and I'm not sure i f the level of ios you'd have on it would do that. not something I've ever tinkered with TBH.
 
Old 01-05-2008, 10:42 PM   #7
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
you are the man!
 
Old 01-06-2008, 10:18 AM   #8
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Did you ever connect the trunked switchport to a single NIC configured for trunking on your linux box for inter-vlan routing -or- did you connect 2 of the non-trunked NIC's to separate switchports/vlans?

The reason I ask is this thread has sparked some interest on my part and I plan on trying to use a linux box for inter-vlan routing in a lab environment. I was curious about how (in your example) you configured the linux box to handle non-802.1q frames (vlan 1). If I understand cisco switches correctly, vlan 1 or ANY vlan marked as "the native vlan" will never transmit a frame with an 802.1q header across a trunked port. So in your example of using vlan 1-2 (instead of vlan 2-3), I would think vlan 1 attached devices would be able to communicate between each other, but not be routed to other vlans unless the trunked NIC on the linux box also had an interface defined for non-802.1q traffic (like eth0).

Just curious... I hope to try this sometime this week.
 
Old 01-06-2008, 12:41 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well any switchport using trunking on a port using 802.1q trunking (as opposed to ISL trunking) can have one vlan additionally marked as a native vlan. this is most often the way a voip phone and a desktop share a single port... the phone bridges ethernet traffic and operates in itself on a tagged voice vlan, whilst the pc uses the untagged connection and so needs no meddling. vlan1 is a default only, any other vlan can replace it. obviously, only one vlan can be the native one per port (as the frames are totally untagged... that vlan can also be tagged as well, and in that case i'm not sure what the rationale is to tag or not... probably seperate mac tables for native and the corresponding table...

Last edited by acid_kewpie; 01-06-2008 at 12:43 PM.
 
Old 01-07-2008, 06:14 AM   #10
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I have the enterprise OS on this 2924. So from what I have read I guess this little switch can do some tricks. I guess what I am looking for is 802.1p QoS to prioritize VOIP traffic for better call quality. This is a layer 2 switch so would 802.1p QoS or better said can 802.1p QoS be done on my linux router?

http://www.kmj.com/cisco/c2924.html
 
Old 01-07-2008, 06:47 AM   #11
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
I understand your reply. But thats not what I was trying to refer to in my post. Sorry for the confusion. Poor wording on my part.

What I was trying to ask metallica1973 was...

1) Did he end up using the trunked switch port or just plug the firewall interfaces into separate switchports/vlans?

2) If he did use the trunked port, how did he account for inter-vlan routing between vlan 1 and 2 (vs. using vlan 2-3), if the cisco switch is not going to encapsulate vlan 1 into an 802.1q frame?

What I was trying to refer to in my post (rather poorly) was I think the eth0 interface would handle the vlan 1 non-802.1q frames. The same physical interface the vlan virtuals are created against. At least if you follow the candelatech vlan article with some minor changes at layer 3. Basically, I do not see why you can't assign an IP to eth0 for non-802.1q frames -and- assign IP's to the vconfig created virtuals. Whether or not this will work on a linux based trunked port???? I don't know yet.

Long pause...

I just booted my laptop into FC8 and followed the candelatech article example and created vlan 2,3 and 10 against eth0. Vconfig created eth0.2, eth0.3 and eth0.10 virtuals respectivly. BTW: I had to load the 8021q module. I assigned arbitrary IP's to all virtuals, but I left eth0 configured with its DHCP assigned IP. In the candelatech article, the author removes the IP from eth0. My laptop still communicates on my home network just fine via eth0, but until I can connect my laptop to an 802.1q trunked port, I really have no way of testing inter-vlan routing and whether or not eth0 will handle the non-802.1q frames across the trunk. Based on the fact my laptop is still communicating on my network, it appears to be working as expected. But then I could be having a brain-fart.

Hopefully, I will get some time in the lab this week to test using a linux box for inter-vlan routing. This has been an intersting topic.
 
Old 01-07-2008, 07:02 AM   #12
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
scowles,

Thanks for your replying to my post. To awnser your questions:

Quote:
1) Did he end up using the trunked switch port or just plug the firewall interfaces into separate switchports/vlans?
I plugged my firewall interface for the LAN into VLAN1(trunked switch port). I plan on changing my configurations to add more VLANs and leaving the trunk by itself(VLAN1). I have an array on ports assigned to that VLAN and I will change that.

Quote:
2) If he did use the trunked port, how did he account for inter-vlan routing between vlan 1 and 2 (vs. using vlan 2-3), if the cisco switch is not going to encapsulate vlan 1 into an 802.1q frame?
That is a very good question which I am still trying to figure out. I do not know whether or not my switch which is a WS-C2924-XL-EN (12.5) can perform 802.1q. I would like to enable that to provide better voice quality for my VOIP phones. As far as the inter-vlan routing I believe that has to be done from a layer 3 device. In my case it would be my linux firewall/router and using vconfig. If you could shed some light on this that would help. thanks

Last edited by metallica1973; 01-07-2008 at 07:11 AM.
 
Old 01-07-2008, 08:28 PM   #13
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Perfect scenario for a router-on-a-stick configuration.

http://www.cisco.com/warp/public/473/50.shtml

Obviously if you are using your Linux box for the router portion you'll have to work out that configuration, but the overall guide should give you some direction.
 
Old 01-09-2008, 06:15 AM   #14
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
I did get a chance to try this in a lab environment. Worked great! All PC's were able to ping each other on different vlans via linux box acting as router on a single trunked port connection.

The vlan configuration on the linux box was pretty straight forward. Followed the candelatech article for creating the vlan interfaces along with configuring the primary interface (eth0) for vlan 1.

NOTE: I am posting example from memory, not copy/paste. I should be close and will update post if needed.

Code:
LINUX FC8 DISTRO
# modprobe 8021q

# vconfig add eth0 2    (vlan 2)
# vconfig add eth0 3    (vlan 3)
# vconfig add eth0 4    (vlan 4)

# ifconfig eth0   10.10.1.1 netmask 255.255.255.0     (vlan 1)
# ifconfig eth0.2 10.10.2.1 netmask 255.255.255.0     (vlan 2)
# ifconfig eth0.3 10.10.3.1 netmask 255.255.255.0     (vlan 3)
# ifconfig eth0.4 10.10.4.1 netmask 255.255.255.0     (vlan 4)

SWITCH CONFIG (3550) Configured as layer 2

interface f0/1
description Connection to PC1
spanning-tree portfast

interface f0/2
description Connection to PC2
switchport access vlan 2
spanning-tree portfast

interface f0/3
description Connection to PC3
switchport access vlan 3
spanning-tree portfast

interface f0/4
description Connection to PC4
switchport access vlan 4
spanning-tree portfast

interface f0/48
description Connection to Linux box
switchport trunk encapsulation dot1q
switchport mode trunk

interface vlan 1
description Management vlan
ip address 10.10.1.2 255.255.255.0

#### global config mode ###
ip default-gateway 10.10.1.1

PC IP STACK CONFIG

PC 1 = 10.10.1.5/24, GW = 10.10.1.1 (vlan 1 interface)
PC 2 = 10.10.2.5/24, GW = 10.10.2.1 (vlan 2 interface)
PC 3 = 10.10.3.5/24, GW = 10.10.3.1 (vlan 3 interface)
PC 4 = 10.10.4.5/24, GW = 10.10.4.1 (vlan 4 interface)
Also, I noticed that FC8 supports vconfig in the "ifup" network script. But I did not get a chance to figure out how to configure this part so that vlan interfaces were configured on boot-up.
 
Old 01-09-2008, 06:31 AM   #15
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i had tried this before, centos 4 and a 2924-XL and couldn't get a thing... well native vlan worked, but nothing else. didn't have enough resources to probably investaigate with wireshark or such, so i gave up... nice to know it must've been me!
 
  


Closed Thread



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
linux+cisco configuration binary_dreamer Linux - Networking 1 11-01-2007 09:30 PM
How to use linux PC as cisco router badall Linux - Networking 3 06-25-2007 02:15 AM
Cisco vpn 4.6 for linux suavecu Linux - Software 2 07-25-2006 02:38 PM
linux cisco gabsik Linux - Hardware 3 05-31-2006 09:06 AM
Cisco Linux Clients Kedelfor Linux - Networking 3 04-15-2005 06:26 AM

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

All times are GMT -5. The time now is 12:40 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