Date: Wed, 9 May 2007 02:24:08 -0500 From: "Jack Barnett" <jackbarnett@gmail.com> To: "User Iam" <vramnum10@gmail.com>, freebsd-questions@freebsd.org Subject: Re: ip refresh, resolv.conf and local scripts on startup? Message-ID: <dedb607c0705090024g784e5591y8610b16793422ac8@mail.gmail.com> In-Reply-To: <727fc2ee0705081819o1177a702u490b9ef24c7c9b02@mail.gmail.com> References: <dedb607c0705081411i287cd4e6ue8f9dd8afc5753a8@mail.gmail.com> <727fc2ee0705081819o1177a702u490b9ef24c7c9b02@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
hrm, thanks, but this doesn't seem to work: `ifconfig xl0 down` doesn't do anything... executes without error, but the interface stays up. `/sbin/dhclient` gets a new IP, but doesn't "re-do" the firewall with new IP, so everything is broken. echo nameserver 123.34.45.67 > /etc/resolv.conf echo nameserver 321.23.67.328 >> /etc/resolv.conf This is over written on startup/reboot by the dhcpclient. If I modify the file, then it tries to "correct" it self and over writes the file with the DNS servers provided via the DHCP server. Any other ideas? Thanks, Jack On 5/8/07, User Iam <vramnum10@gmail.com> wrote: > > Hi > > To get a new ip > > Do > > /sbin/ifconfig ethX <use correct number> down > > /sbin/dhclient # to get a new ip.. > > > Then for resolv.conf > > > echo nameserver 123.34.45.67 > /etc/resolv.conf > echo nameserver 321.23.67.328 >> /etc/resolv.conf > > > HTH > > User Iam > > > On 5/8/07, Jack Barnett <jackbarnett@gmail.com> wrote: > > > > I have a script that updates some dynamic DNS records (can be run as > > non-root if needed). > > > > It needs to be run on startup - after network is configured and after > > rc.firewall (it'll get blocked if it's run before the firewall is > > setup). > > > > What is a good place to put this? I could put it at the end of > > rc.firewall, > > but is there a better place to put it? > > > > Also how do I refresh a dynamic IP without rebooting? > > > > Sometimes my cable modem gets messed up and under windows I just do: > > ipconfig /release > > ipconfig /renew > > > > and it gets new IP and sets everything up. In FreeBSD is there a way to > > reconfigure everything without rebooting? > > > > (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??] > > > > 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? > > > > thanks. > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to " > > freebsd-questions-unsubscribe@freebsd.org" > > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?dedb607c0705090024g784e5591y8610b16793422ac8>