LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-07-2012, 03:47 AM   #1
Sodb
LQ Newbie
 
Registered: Mar 2012
Posts: 3

Rep: Reputation: Disabled
Setting dhcp in virtual box for 32 subnets.


Hi everyone.

Im new in linux and networking, and i try to mount my 1 dhcp server, i have a task to split my net to 32 subnets with 172.16/12, in internal network.

I start virual mashines on 2 subnets named linux and windows.

Then to divide 172.16/12 on 32 subnets, i take 5 bits for it - 172,16/17, my mask become 255.255.128.0

My interfaces configuration:
Code:
auto lo
iface lo inet lopback

auto eth2
iface eth2 inet static
address 172.16.128.0
netmask 255.255.128.0

auto eth1
iface eth1 inet static
address 172.16.0.0
netmask 255.255.128.0
My dhcp configuration:
Code:
subnet 172.16.0.0 netmask 255.255.128.0{
interface eth1;
range 172.16.0.0 172.16.127.254//im not sure if thats good
option subnet mask 255.255.128.0
option routers 172.16.0.0//im not sure if thats good
}

subnet 172.16.128.0 netmask 255.255.128.0{
interface eth2;
range 172.16.128.0 172.16.255.254
option subnet mask 255.255.128.0
option routers 172.16.128.0
}
dhcp start without problems, but my others virtual machines dont receive any ip,in fact they dont receive any packet from dhcp, if anyone could help, it would be apreciated, thanks in advance.

Last edited by Sodb; 03-12-2012 at 07:13 AM.
 
Old 03-07-2012, 02:59 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,939

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
And the nic's are set in bridged mode? See this post. https://forums.virtualbox.org/viewtopic.php?f=1&t=39224

It may be that you can set the IP range in virtualbox using nat. Remember that nat has it's own virtual dhcp server in almost all VM's.


I think I'd be more likely to run static addresses if you need it for some reason. I also almost always use nat and just let it do what it wants.

Last edited by jefro; 03-07-2012 at 03:02 PM.
 
Old 03-12-2012, 07:10 AM   #3
Sodb
LQ Newbie
 
Registered: Mar 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I finaly manage to solve it, as newbie i make stupid mistakes.
Here working configuration:
Code:
sudo vi etc/network/interfaces
Code:
auto lo
iface lo inet lopback

auto eth1
iface eth1 inet static
address 172.16.0.1
netmask 255.255.0.0

auto eth2
iface eth2 inet static
address 172.16.128.1
netmask 255.255.128.0
Code:
sudo vi etc/dhcp/dhcpd.conf
Code:
subnet 172.16.0.0 netmask 255.255.128.0{
interface eth1;
range 172.16.0.2 172.16.127.250
option subnet-mask 255.255.128.0
option routers 172.16.0.1
}

subnet 172.16.128.0 netmask 255.255.128.0{
interface eth2;
range 172.16.128.2 172.16.255.250
option subnet-mask 255.255.128.0
option routers 172.16.128.1
}
Then you start or restart you network:
Code:
sudo services networking start
sudo services networking restart
my have been bugged so i needed to reboot pc,
then you start dhcp:
Code:
sudo etc/init.d/isc-dhcp-server start
and all others virtual machines, also i forgot in beginig put second adapter, on internal network and name it windows.

Last edited by Sodb; 03-12-2012 at 07:34 AM.
 
  


Reply


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
need help setting up a bridge connection on Virtual Box (Ubuntu) 3vra Linux - Networking 1 07-23-2009 11:48 AM
LXer: Setting Up a SME Server Test Environment with Virtual Box on Vista LXer Syndicated Linux News 0 02-03-2009 09:00 AM
Setting up Shared Folders in Virtual Box? Ordinary12 Ubuntu 1 10-04-2007 07:07 PM
DHCP for 2 subnets omlex Linux - Networking 11 03-04-2007 06:41 PM
Setting up a static IP on linux box which obtains an IP via DHCP vxc69 Linux - Networking 19 07-13-2004 05:18 AM

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

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