Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2007 12:31:39 +0800
From:      "Richard Simmonds" <yunikan@gmail.com>
To:        "'RW'" <fbsd06@mlists.homeunix.com>
Cc:        freebsd-questions@freebsd.org
Subject:   ip refresh, resolv.conf and local scripts on startup?
Message-ID:  <!&!AAAAAAAAAAAYAAAAAAAAAPOytc9vInVGkl54LcL/nGDCgAAAEAAAAOaMkWMXYsFIsiYSA4lclHABAAAAAA==@gmail.com>
In-Reply-To: <20070509132217.010c71af@gumby.homeunix.com.>
References:  <dedb607c0705081411i287cd4e6ue8f9dd8afc5753a8@mail.gmail.com> <20070509132217.010c71af@gumby.homeunix.com.>

next in thread | previous in thread | raw e-mail | index | archive | help

> (rc.firewall uses this to get network info:
>         onet=`ifconfig xl0 | grep "inet " | awk '{print $6}'`
>         oip=`ifconfig xl0 | grep "inet " | awk '{print $2}'` Meaning, 
> rc.firewall would also have to be re-ran if the IP is new).
> [also to make things more complicated, I think I need a rule in 
> rc.firewallto allow for DHCP clients to go out?  It gets blocked on 
> external interface when firewall comes up??]

Looks like you're using ipfw, in which case this works for me:
# /etc/rc.d/ipfw restart

> Also how do I override /etc/resolv.conf?  DHCP client configures it I 
> think and sets it up to point to my ISP DNS servers (which suck) and 
> would like to give it mine instead of there, but it keeps getting over 
> written on startup when it gets a DHCP lease?

In dhclient.conf, add your own DNS servers, plus your ISP's as backup:

Interface "xl0" {
prepend domain-name-servers xxx.xxx.xxx.xxx, yyy.yyy.yyy.yyy;
request subnet-mask, broadcast-address, routers, domain-name-servers;
}


Get new ip:
# dhclient xl0


Hope this helps




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?!&!AAAAAAAAAAAYAAAAAAAAAPOytc9vInVGkl54LcL/nGDCgAAAEAAAAOaMkWMXYsFIsiYSA4lclHABAAAAAA==>