LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 09-24-2012, 06:04 AM   #1
pinsky
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Rep: Reputation: Disabled
Setting up a virtual network with DHCP on host


I'm doing a voluntary network workshop on basic networking in a Linux environment. The idea is to show them how networking works, and give possible solution for migrations to Open source solutions instead of current pure Microsoft ones.

I am limited on using a live USB, or in the worst scenario a live DVD. I was planning on having Lubuntu with KVM preinstalled and have 2 small Debian installations as virtual machines.

The idea was to try to set a DHCP server on the Lubuntu host, and have it assign the IP-s for the virtual client machines.

Then try to separate the clients, so that each is on a separate LAN, and set the host as router with NAT, so that the clients can access the Internet through the host, and ping each other even though they are on different subnets.

Then we'd also like to setup a DNS on the host, so the subnets can have each a domain name...

Which virtual networking option would you suggest?

I don't want the bridged option in which the hosts will get their IP from the real router cause then we cant experiment with router setup on the host computer.

However, if we use the KVM NAT, then we again can't setup the router on the host.

I guess what we're looking for is how to achieve just a "virtual physical" network connection, and leave all the other handling to the host.
 
Old 09-24-2012, 06:12 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
As there's not really such a thing as kvm networking, and the config is really just pure Linux it's really simple to put together whatever network layout you want internally. Create internal bridges for whatever internal networks you want, as as long as your host also has an interface on that network then you can enable ip_forward and route out to them, or NAT them out. Why can't you just use the default NAT config? I don't really see where the issue is with this. You can certainly pull out the MASQ config from iptables if you don't actually want NAT, that's probably the simplest way to get where you appear to want to be.
 
Old 09-24-2012, 06:50 AM   #3
pinsky
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
Why can't you just use the default NAT config? I don't really see where the issue is with this.
I thought it was some internal KVM networking mechanism being used to handle NAT and assigning IP to virtual clients.


I will try to do what you told me. Do all the settings for setting bridges on both host and virtual clients take place in:

Code:
/etc/network/interfaces
 
Old 09-24-2012, 06:54 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
No, DHCP is generally done by a noddy dnsmasq instance. The bridges are, I *think* loaded by libvirt (which is outside of KVM technically), but only to keep the configuration separate. You can put the configs directly in that location (or the /etc/sysconfig/network-scripts original location) and load virbr1 on demand easily enough, but there's probably no real need to undermine the management wrapper it does put in place.
 
Old 09-24-2012, 07:15 AM   #5
pinsky
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
So the next steps are?
  • Disable dnsmasq
  • Setup bridges with brctl
Is this what you ment by:
Quote:
Originally Posted by acid_kewpie
but there's probably no real need to undermine the management wrapper it does put in place.
"Use the standard way to make bridges"?
  • Install a DHCP server on the host
 
  


Reply

Tags
dhcp, kvm


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
Setting a SSL on a new virtual host eliassal Linux - Server 1 10-22-2010 06:38 AM
setting up name based virtual host on lan shanecaldeiro Linux - Newbie 9 05-22-2009 05:53 PM
Apache Virtual Host problem - DNS or DHCP issue? costrevs Linux - Software 16 03-23-2005 08:50 AM
Setting up a virtual host zupidupi Linux - Networking 2 01-30-2005 09:58 AM
Setting up webalizer for virtual host hct224 Linux - Newbie 18 11-10-2004 04:31 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration