LinuxQuestions.org
Review your favorite Linux distribution.
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 04-26-2008, 02:02 PM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 50
Route two networks


I've an Ubuntu computer running Ubuntu 8.04 with vmware installed. I have two interfaces:
eth0 which connects to my router on the 10.39.10.0 net with netmask 255.255.255.0
vmnet1 which is the virtual network where my Windows 2003 Server and RHEL virtual boxes are located, which is on the 10.39.17.0 net with netmask 255.255.255.0.

Now, I want the boxes on the 10.39.17.0 net on the interface vmnet1 to be able to ping boxes on the 10.39.10.0 net on interface vmnet1.

Simple: route two networks together, no NAT or other stuff like that. Everyone will be able to ping everyone.

Problem is everywhere Google takes me people mess around with NAT and stuff.
 
Old 04-26-2008, 03:21 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
well that's really not a great architecture, and it is generally going to be much more preferable to do nat or better still, bridging, but to do what you want to do, you just need to route the vm destined traffic to the host box and enable ip forwarding on the box. there's nothing acutally vmware specific to it in any way- and hence probaly why you're having trouble tracking it down... Just run "echo 1 > /proc/sys/net/ipv4/ip_forward" and it should work. obviously that also necessitates the internal machines using the host as the default gateway too.
 
Old 04-26-2008, 04:15 PM   #3
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Well I do not see the point of using NAT since that would "hide" one network from the other, which I do not want.

Bridging is exactly what I want to do here. Just like a normal Cisco Router (read: real router, not one of those home-user ones). Put to networks together. There must be some way to do that in Linux.

I'll try ip-forwarding. Thanks.
 
Old 04-26-2008, 06:24 PM   #4
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Anyway, ip forwarding seems to have done it. My two networks are now working in perfect order. And my DHCP server on my Windows 2003 is up and running. Everything's perfect! Thanks! :D
 
Old 04-27-2008, 03:40 AM   #5
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 NAT is just one approach and not one that really suits all, but suits more than routing i think. why should the machine upon which a virtual machine reside define it's network layout? It's an arbitrary restriction that isn't really that nice. move a vm from one host to another and you have to change the ip? yuck. obviously if you only have one vm host then that doesn't exist, but the logic still applies, say in physical to vm conversions.
 
Old 04-27-2008, 06:06 AM   #6
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Well one of the virtual machines is a dhcp server and dns server. It's a total of five machines in there, two of them with dual boot. And since there are a lot of services in there (like web, ftp, etc) on different machines I really want to be able to reach it from my 'real' network.
 
Old 04-27-2008, 06:59 AM   #7
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
oh totally, but the most conventional method would be bridging. machines should be seperated by function, security level etc... not architecture like we have here.
 
Old 04-27-2008, 07:14 AM   #8
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Oh.. I am very new to this, just starting to play around. Perhaps you have some links where I can learn more?

What I'm trying to do is getting a Microsoft Windows domain to play nice along with Linux servers and clients. But I can always through in some network lessons, too.
 
Old 04-27-2008, 10:30 AM   #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 if you've not explored bridged interfaces then you really must. I assumed you had a logical reason for not already doing so. When you brigde and interface, the host machine essentially acts like a switch as far as networking is concerned. so traffic just passes straight through the host hardware just like a network switch or hub, all on the same network. If you did then have seperate networks for different functions you'd use something like 802.1q tagging to pass multiple networks through the host, again just like a normal (but more complex) switch.
 
Old 04-27-2008, 02:54 PM   #10
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Hm.. I tried to set up bridging using the brctl utility but I never managed to get the two networks to access each other. The furthes I got was to the virtual machines to be able to ping the eth0 interface on the host machine.

I do not really understand the difference between forwarding and bridging. Do they operate on different levels?

Btw, I want routing, not switching. Since there is two separate networks. I also need to make sure that my ubuntu host machine, while acting like a router between the two networks, will be able to talk to my Linksys router, to make sure that they both know about each other's networks.

To explain my situation a little bit further:

The lab is inside a linksys router which connects the 10.39.100.0 and 10.39.10.0 networks. The physical lab machines are located on the 10.39.10.0 net, the other network is just for network devices outside the lab. Now one of those machines runs a number of virtual machines. I want all these machines to be on their own network: 10.39.17.0.

So of course devices on all networks should be able to talk to each other. The internet is reached via the 10.39.100.0 network, and I will just set up firewall rules in the linksys router to block internet traffic to specific virtual machines.
 
Old 04-28-2008, 08:53 AM   #11
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 vmware handles all the bridging config, no need to do brctl stuff. if you really want two seperate networks then what you're doing is the only option (save for NAT), but my point was that it's just really not a good architecture, and you *should* only want a single network in the first place.
 
Old 04-29-2008, 02:38 AM   #12
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Problem is that single network means single dhcp server. But I'll continue to dig into this and see what I'll end up with.

Problem right now is dns. Host resolves fine but ping doesn't. But that's another story. :P
 
  


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
Configuration of a route through 2 networks jmcustiel Slackware 8 07-14-2007 11:24 PM
how to route internal Networks by IP tables? quazidaniel Linux - Networking 4 10-12-2005 10:32 AM
can't route/ping between networks ender03 Linux - Networking 21 02-01-2005 06:14 AM
Setting up Static Route for two Networks ctrylace Linux - Networking 2 07-23-2004 03:18 AM
Two networks - one route out diveguy Linux - Networking 5 08-29-2002 05:36 PM

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

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