Re: dhcp and default gateway
> > > I have my network set up to use dhcp. The clients can
> > > connect, ping, ssh, etc. to the server, but they can't
> > > connect beyond my gateway. The only part of my static
> > > network setup that isn't present in my dynamic setup is the
> > > default gateway.
> > > How can the dhcp server tell the client which default
> > > gateway to use? Or is this something I need to somehow put
> > > in my client configuration?
> [...]
> > Gateway seemes to be provided through DHCP.
> >
> > But you may add it by (I think, but never tried):
> >
> > option routers 192.33.137.250;
>
> This is how I do it. Add the above line in /etc/dhcpd.conf and
> you should be set. You may also consider adding the
> following line if your running dns as well:
>
> option domain-name-servers 192.168.1.2;
>
> which is also covered in the man page below.
>
> > According to "man dhcp-optons"
> >
> > option routers ip-address [, ip-address... ];
> >
> > The routers option specifies a list of IP addresses for
> > routers on the client's subnet. Routers should be
> > listed in order of preference.
> >
> > Cherrs :)
I have the following as my /etc/dhcpd.conf file:
# dhcpd.conf
option routers 192.168.1.1;
option domain-name "kwiqsilver.org";
option domain-name-servers 68.2.16.30, 68.1.208.30;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.101 192.168.1.200;
option broadcast-address 192.168.1.255;
}
# dhcpd.conf
The clients can connect, but when I try to ping past the gateway I get
"Network is unreachable" errors.
Reply to: