View previous topic :: View next topic |
Author |
Message |
sepp Guru
Joined: 11 Jul 2002 Posts: 330
|
Posted: Thu Jul 31, 2008 7:00 pm Post subject: 2 dhcp servers: how to force clients to listen to 2nd only? |
|
|
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 |
|
|
poly_poly-man Advocate
Joined: 06 Dec 2006 Posts: 2477 Location: RIT, NY, US
|
Posted: Thu Jul 31, 2008 9:05 pm Post subject: |
|
|
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 |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Fri Aug 01, 2008 10:03 am Post subject: Re: 2 dhcp servers: how toI force clients to listen to 2nd o |
|
|
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 |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
|