Le 17 mai à 15:01:49 Jean Magnan de Bornier <[EMAIL PROTECTED]> a écrit notamment:
> Hello all, > I am setting up a way to have my laptop automatically get a correct ip > address. > > When I am at my office, I have a fixed ip; at home (on a > private network) I use dhcp. > I know I can use quickswitch for that but I want something really > automatic, so after some search I ended up with this in my > /etc/conf.d/net: > > iface_eth0="dhcp" > ifconfig_eth0=( "dhcp" "194.199.136.151" ) > dhcpcd_eth0="-t 30" > ifconfig_fallback_eth0=( "194.199.136.151 netmask 255.255.255.0 " ) > ipaddr_fallback_eth0=( "194.199.136.151 gw 194.199.136.250" ) > > This works great, but as dhcp overwrites /etc/resolv.conf, when I go back > to my fixed ip my dns servers are not the ones I need (still the ones I > use at home). My dns names for office are set in /etc/resolv.conf.fac. Is > there a way to have the machine know which dns servers to use? Well, as my question is not answered yet, let me reformulate what I need in a shorter way: I want to execute "ln -sf /etc/resolv.conf.fac /etc/resolv.conf" *before* /etc/init.d/net.eth0, so that if I am at the "fac" (my office) location I have these dns set up, but if I am home with dhcp the resolv.conf file will be overwritten. Should I add a script in /etc/init.d for that, or is there something simpler? cheers, -- Jean Magnan de Bornier | email: jean-at-bornier.net -- gentoo-user@gentoo.org mailing list