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


Reply
  Search this Thread
Old 07-27-2011, 03:07 PM   #1
Grejeru
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
CentOS VLANs and Cisco Catalyst switch (router on stick problem)


Hello People,

So starting from beginning, I have router based on CentOS system with DHCP server. In one eth I have fiber converter attached in second one I have Cisco Catalyst switch connected. From the switch rest of ports are used to provide internet traffic to rest of network. I wanted to divide each segment of network (based on switch ports) that they don't see each other (it'll be good for me if someone will connect his wireless router to the network not to WAN by LAN port and start be a second DHCP server).

So my network configuration:
CentOS:
DHCP with range 10.0.0.1/8 network

Switch ports:
1 - CentOS DHCP
2 - second server
3 - first part of network
4 - second part of network
5 - third part of network
6 - link to office building
7 - next part of network


Parts of networks I've assigned IPs 10.network_part.subnet_part.client_ip so I have addresses for clients: 10.1.1.2/8, 10.2.1.3/8, 10.3.0.4/8, etc ...

I've decided to give each port it's own VLAN like below:
Port / VLAN
1 / trunk
2 / 102
3 / 103
4 / 104
5 / 105
6 / 106
7 / 107


I've configured switch ports by using:
(config)# interface Gi0/Port_Number
(config-if)# switchport access vlan VLAN_NUMBER


and configured trunk port for router:
(config)# interface Gi0/1
(config-if)# switchport trunk allowed 1-107
(config-if)# switchport trunk encapsulation dot1q
(config-if)# switchport mode trunk


And after doing that whole network stopped working.
I think that cisco part of configuration is OK (at least customer ports, I don't know if there is any additional info needed for trunk port).
On CentOS router I didn't setup anything regarding VLANs ...

Could any help me with proper configuration?

Network diagram pasted in jpg.

Best Regards
Attached Thumbnails
Click image for larger version

Name:	network.jpg
Views:	43
Size:	29.4 KB
ID:	7681  

Last edited by Grejeru; 07-27-2011 at 03:42 PM. Reason: Bolding some parts of text for better view
 
Old 07-27-2011, 03:40 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
you are routing /8 subnets??? that's just mental... I hope it makes sense in a wider context, but it doesn't sound like it does.

as you mentioned you haven't set up *anything* for vlans on the centos side, that's a pretty good reason it's not working. To set up vlan interfaces, this looks reasonable. http://wiki.xdroop.com/space/RedHat/VLAN+definition it's all pretty easy actually.

You might want to make one network native to the centos router. only having vlan interfaces can lead to lots of problems. "switchport trunk native vlan 101" for example.

Last edited by acid_kewpie; 07-27-2011 at 03:42 PM.
 
Old 07-27-2011, 03:56 PM   #3
Grejeru
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
It's not I'm routing whole 10.0.0.1/8.
Just when the network started to live I had to have clear view on each line, so each line had it's own 10.x subclass, then on the line each building had it's own 10.x.y subclass. So when it was starting it was clear to know, that this IP 10.x.y.z was line X, building Y on this line, customer Z in that building.
 
Old 07-27-2011, 04:49 PM   #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
OK but you netmasks are /8 still. They are all the same subnet. Nothing will try to route if its not in a different subnet.
 
Old 07-28-2011, 02:08 PM   #5
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
OK, Chris is absolutely right, you have two problems.

You have split your network into 6 vlans, so you need 6 subnets on your router. The /8 you specified are all the same subnet. /8 = 255.0.0.0 ; 10.1.0.0 255.0.0.0 = network 10.0.0.0. 10.2.0.0 255.0.0.0 = network 10.0.0.0. See? doesn't work.

You need something like -

Int Vlan Network Router Addr
eth1 102 10.2.0.0/16 10.2.1.1
eth1:103 103 10.3.0.0/16 10.3.1.1
eth1:104 104 10.4.0.0/16 10.4.1.1
eth1:105 105 10.5.0.0/16 10.5.1.1
eth1:106 106 10.6.0.0/16 10.6.1.1
eth1:107 107 10.7.0.0/16 10.7.1.1

See how the numbers line up? Always helps avoid mistakes if you can do it this way.

Configure the eth interfaces following a guide such as this -

http://www.tummy.com/journals/entrie...0061130_063931

Then configure your trunk on the cisco as you have except add

(config)# interface Gi0/1
(config)# switchport trunk native vlan 102

You will need to configure DHCP pools on your DHCP server with the correct masks (/16) and the correct default gateways, as per the table above.

I would never recommend making a change like this on a live network. Its always bound to bad.

No reason why you couldn't test his with a few spare ports and a couple of laptops.

If in doubt, bench test it first.

Last edited by baldy3105; 07-28-2011 at 02:09 PM.
 
  


Reply



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
Vlans with ClearOS adn Cisco 3560G Layer 3 Switch hladamjr Linux - Networking 0 11-08-2010 09:11 AM
Checking to see if SSH is enable on a Cisco Router/Switch seefor Programming 8 04-23-2010 03:05 PM
ARP sharing between Linux router and Cisco switch zal1en Linux - Networking 4 08-15-2009 05:41 AM
Problems connecting to Cisco Catalyst switch via Console irotas Linux - Networking 1 01-03-2006 06:01 AM
TACACS+, Cisco router/switch authentication sancho5 Linux - Networking 2 03-28-2003 03:22 AM

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

All times are GMT -5. The time now is 05:16 PM.

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