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-23-2007, 01:38 AM   #1
Padawan.AVT
Member
 
Registered: Feb 2006
Distribution: Gentoo, Slackware, Debian, Suse
Posts: 86

Rep: Reputation: 15
Similar networks


I need to set up a router.

My network has 4 segments:
10.5.0.0 at eth0
10.5.1.0 at eth1
10.5.2.0 at eth2
10.5.3.0 at eth3

Netmask is 255.255.252.0

The problem is when I assign IP addresses to corresponding NICs (network cards) all traffic goes through eth0 (10.5.0.0 incorporates all other networks)

Routing table looks like this:

Dest_______Gateway___Netmask________Iface
10.5.0.0___0.0.0.0___255.255.252.0__eth0
10.5.1.0___0.0.0.0___255.255.252.0__eth1
.....
127.0.0.1__0.0.0.0___255.0.0.0______lo


If I change order of networks (i.e. eth3 has 10.5.0.0 and eth0 has 10.5.3.0) I got the similar results.

I don't want to make 4 different subnets (with 255.255.255.0 netmask) because then AFAIK I need to use NAT in that case. Traffic between these 4 segments must flow with minimal additional efforts. NAT will be used only for accessing external networks

How can I make each network use only it's NIC?
 
Old 07-23-2007, 01:45 AM   #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 say "each network" but there is only one network there, not 4. i take it you don't really have much knowledge on subnetting? firstly i'd suggest that your ip structure is very wrong, and you should change your netmask to 255.255.255.0 so you DO have 4 subnets. then just enable ip forwarding (echo 1 > /proc/sys/net/ipv4/ip_forward) and you'll be able to reach each other just fine, assumign this machine is the default gateway for all networks.

if you are going to insist on doing what you are, then you're actually looking to turn your machine into a switch, not a router, which to me seems like a complete waste as you could just use a $5 switch to do the job for you in 10 seconds.
 
Old 07-23-2007, 09:24 AM   #3
Padawan.AVT
Member
 
Registered: Feb 2006
Distribution: Gentoo, Slackware, Debian, Suse
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks! That's what I was looking for.

Switch is not a solution in my case because this PC will be a gateway for a huge number of PC-s.
 
Old 07-23-2007, 10:06 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 that's the point... that *IS* a switch...
 
  


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
Looking for somewhat similar to (Part 2) potatoque Linux - Software 1 10-19-2006 01:15 AM
Looking for somewhat similar to potatoque Linux - Software 4 10-14-2006 11:50 PM
Similar code for c vishalbutte Programming 5 01-17-2006 04:25 AM
dc++ or similar porio Linux - Software 3 04-27-2005 09:00 AM
similar problem here juby Linux - General 6 02-06-2003 06:44 AM

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

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