FreeBSD as a DHCP server on a VLAN'ed network

Hi all.

I'm totally new to FreeBSD, I tried FreeBSD 8.0 (stable version). I want to try FreeBSD as a DHCP server on a VLAN'ed network. I don't have problems on the installation.

I read somewhere that I have to confgure rc.conf for my network settings and resolv.conf for the DNS. Our network is behind a firewall and if I want unrestricted Internet connection I make the firewall as a gateway and set an ip to connect to the net.

I tried this in my rc.conf:

Code:
hostname=" server name"	
defaultrouter="gateway"
ifconfig_device="inet IP machine netmask 255.255.255.0"

and my resolv.conf

Code:
nslookup file bind
DNS Server = >public dns

This is what I do on windows boxes when I update them manually, but on FreeBSD, I'm unsuccessful. What did I miss?

Thank you in advance.
 
Hi, I've been reading some FreeBSD tutorials, almost all of them just use a single-subnet DHCP server as example. I would like to ask advice about using an alias or VLAN tagging.

Thanks in advance
 
Yes, it is already set up in our switches (Cisco 500's and 2900's). Our current DHCP server is a Windows box serving around four VLANs on 100.x, 300.x and 200.x subnets. I just want to transfer the DHCP service to a FreeBSD box. I consider this as a challenge and I will do anything to run this FreeBSD box.
 
I'm guessing the DHCP server is in a seperate server VLAN? That's usually the case and you don't have to do anything. Just configure the correct IP address and subnet mask on the server and you're good to go, the ip-helpers will do the rest.

It's also possible the 'original' DHCP server is on all four VLANs (trunked connection). In that case just define the correct VLAN interfaces on the FreeBSD box.
 
Will my dhcpd.conf look like this?

Code:
#-100 vlan
subnet 192.168.100.0 netmask 255.255.255.0 {
  range 192.168.100.2  192.168.210.254
  option routers 192.168.100.1;

#-200 vlan
subnet 192.168.200.0 netmask 255.255.255.0 {
  range 192.168.20.2  192.168.200.254;
  option routers 192.168.200.1;

#-300 vlan
subnet 192.168.300.0 netmask 255.255.255.0 {
  range 192.168.300.2  192.168.300.254;
  option routers 192.168.300.1;

And part of my rc.conf, like this?

Code:
cloned_interfaces="vlan100 vlan200 vlan300"
ifconfig_vlan100="inet 192.168.100.1  netmask 255.255.255.0 vlan 100 vlandev xx0"
ifconfig_vlan200="inet 192.168.200.1 netmask 255.255.255.0 vlan 200 vlandev xx0"
ifconfig_vlan300="inet 172.168.300.1 netmask 255.255.255.0 vlan 300 vlandev xx0"
 
Is this okay?

Code:
ifconfig_vlan100="inet 192.168.100.1 netmask 255.255.255.0 vlan 100 vlandev xx0("
ifconfig_vlan200="inet 192.168.200.1 netmask 255.255.255.0 vlan 200 vlandev xx0"
ifconfig_vlan300="inet 192.168.300.1 netmask 255.255.255.0 vlan 300 vlandev xx0"


Code:
#-100 vlan
subnet 192.168.100.0 netmask 255.255.255.0 {
  range 192.168.100.2  192.168.200.254;
  option routers 192.168.100.1;

#-200 vlan
subnet 192.168.200.0 netmask 255.255.255.0 {
  range 192.168.200.2  192.168.200.254;
  option routers 192.168.200.1;

#-300 vlan
subnet 192.168.300.0 netmask 255.255.255.0 {
  range 192.168.300.2  192.168.300.254;
  option routers 192.168.300.1;
 
Check the range on the 100 and 200 VLANs, they contain a small error. Besides that, it looks good.
 
BTW Sir, is this necesarry ?

Code:
ifconfig_xx0="up"

Code:
#-100 vlan
subnet 192.168.100.0 netmask 255.255.255.0 {
  range 192.168.100.2  192.168.100.254
  option routers 192.168.100.1;

#-200 vlan
subnet 192.168.200.0 netmask 255.255.255.0 {
  range 192.168.200.2  192.168.200.254;
  option routers 192.168.200.1;

#-300 vlan
subnet 192.168.300.0 netmask 255.255.255.0 {
  range 192.168.300.2  192.168.300.254;
  option routers 192.168.300.1;
 
taliez said:
btw sir is this necesarry ?

Code:
ifconfig_xx0="up"
Yes, otherwise the interface itself will be down even though you defined the vlan interfaces.
 
Just a quick question. What if for example the IP address of my FreeBSD server is 192.168.90.90 and my dhcp ranges are 100.x, 200.x and 300.x.

Is this possible?

Thanks.
 
Yes, that possible. You will need to use the ip-helper though.
 
Okay, so I guess 192.168.90.90 will not be pingable in the 90.x network which the servers vlan. Because I tried it now, it's not pingable and manageable. In ssh I can manage it by physical terminal only.

How can this broadcast IP addresses in the network/vlan assuming the ip-helper this is in place in the cisco switches?
 
It sounds like you need to take a long hard look at your routing. There's no reason why the machine shouldn't be ping'able. But that all depends on how your network is configured.

The ip-helper on the Cisco routers will "translate" a client's broadcast DHCP REQUEST into a unicast address. As long as your routing is working correctly your server will receive the request and reply correctly.
 
Back
Top