Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 dhcp servers: how to force clients to listen to 2nd only?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sepp
Guru
Guru


Joined: 11 Jul 2002
Posts: 330

PostPosted: Thu Jul 31, 2008 7:00 pm    Post subject: 2 dhcp servers: how to force clients to listen to 2nd only? Reply with quote

I have a DSL modem / router which has a built in DHCP server. Connected to this device is a file server which also acts as an VPN tunnel to a different network. On this file server I want to run dhcp so that all clients in the network get all the network configuration information needed in order to access computers over the VPN. My problem is that I can not turn off the DHCP on the modem / router (for various reasons). Is there a way to configure the second DHCP server (on my file server / VPN machine) so that clients will always use this dhcp server instead the other one? Is this technically possible to override a dhcp server?

Last edited by sepp on Fri Aug 01, 2008 8:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
poly_poly-man
Advocate
Advocate


Joined: 06 Dec 2006
Posts: 2477
Location: RIT, NY, US

PostPosted: Thu Jul 31, 2008 9:05 pm    Post subject: Reply with quote

No, and this is why network admins have so much trouble when you plug in a router backwards.

The way DHCP works: The client sends a DHCPREQUEST to 255.255.255.255 (broadcast - should hit all computers on all networks, if nothing's stopping it.

Then, a valid DHCP server gives a DHCPOFFER to the client - addressing it by MAC address, because it doesn't have an IP yet.

Yada yada, the thing gets an IP and all is well.

Basically, you should have some sort of NAT/firewall/whatever between the modem and your network. For example, one method would be to throw another network card into your file server, one on the modem side, one on the network side, set up IPTABLES to be a NAT, and be happy.

Sure, DHCP is a flawed system... but we have nothing to replace it with yet... :?

poly-p man
_________________
iVBORw0KGgoAAAANSUhEUgAAA

avatar: new version of logo - see topic 838248. Potentially still a WiP.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Aug 01, 2008 10:03 am    Post subject: Re: 2 dhcp servers: how toI force clients to listen to 2nd o Reply with quote

sepp wrote:
Is there a way to configure the second DHCP server (on my file server / VPN machine) so that clients will always use this dhcp server instead the other one? Is this technically possible to override a dhcp server?


Starting with dhcpcd-4.0.0-rc4 you can blacklist messages from a given DHCP server ID. So provided they aren't using the same ID (they should not, but technically they could) you can use that nice feature :)

So if your router is on 192.168.0.1 and you want dhcpcd to ignore it do this
Code:
dhcpcd -X 192.168.0.1 eth0

OR this in /etc/conf.d/net
Code:
dhcpcd_eth0="-X 192.168.0.1"

OR this in /etc/dhcpcd.conf
Code:
blacklist 192.168.0.1

_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Aug 01, 2008 10:05 am    Post subject: Reply with quote

poly_poly-man wrote:
Sure, DHCP is a flawed system... but we have nothing to replace it with yet... :?


Any system that provides auto-configuration is vulnerable to this. If it was otherwise it would NOT be 100% auto-configuration as you would have to do some configuration.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum