ppp(8) and dhclient(8)

Chuck Swiger cswiger at mac.com
Tue Dec 14 09:54:22 PST 2004


Andrew P. wrote:
> I have a FreeBSD-4.10 host in my network. It's interface is 
> DHCP-configured with a local ip-address, a dns server and a default 
> route. The network is not connected to Internet, so the dns server 
> resolves only local names and the default router only routes local 
> packets. The host sometimes connects to internet via PPPoE. It receives 
> new dns server and default route via IPCP.
> 
> The problem is that the new pair of dns/route seems to conflict with the 
> old one.
> 
> DNS. I put enable dns and resolv writable in ppp.conf, ppp updates 
> resolv.conf, but dhclient rewrites it in some seconds, leaving only 
> local dns server in it.

You want to change the make_resolv_conf() function in /sbin/dhclient-script.

> ROUTER. Default route is configured at startup by dhclient. "add default 
> HISADDR" in ppp.conf will result in error and will not change the route. 
> So we can type "add! default HISADDR" or delete the route first with 
> "delete default". But when ppp disconnects there's no more default route 
> and local packets do not get routed.

You should describe your local network topology using a static route rather 
than a default route, so that you can add and delete a default route via ppp 
without breaking anything.  Add something like this to /etc/rc.conf:

static_routes="local"
route_local="-net 192.168.2.0/24 192.168.1.1"

...assuming your local network has both a 192.168.1.x and a 192.168.2.y 
subnets, and 192.168.1.1 is a gateway which can get to both networks.

-- 
-Chuck


More information about the freebsd-questions mailing list