View previous topic :: View next topic |
Author |
Message |
Enlight Advocate
Joined: 28 Oct 2004 Posts: 3519 Location: Alsace (France)
|
Posted: Mon Aug 17, 2015 10:56 am Post subject: [DHCP] configurer DNS statique et IP dynamique (résolu) |
|
|
Salut à tous,
comme indiqué dans le titre, je souhaiterais configurer mon interface de manière à ce que ma box m'attribue toujours mon IP de manière dynamique via DHCP, mais qu'en revanche, les serveurs DNS soient attribués de manière statique depuis un fichier de conf. Pour ceux qui se demandent pourquoi je veux faire ça, la raison me semble évidente, c'est pour avoir plus de succès avec les filles!
J'ai tenté une première piste mais sans succès en configurant /etc/conf.d/net de la manière suivante :
Code: | dns_domain_lo="homenetwork"
config_eth0="dhcp"
dns_servers_eth0="IP.serveur.no.1 IP.serveur.no.2"
|
mais a priori sans succès... :/
Quelqu'un peut m'aider sur ce coup là svp?
Last edited by Enlight on Sun Aug 23, 2015 6:34 pm; edited 1 time in total |
|
Back to top |
|
|
El_Goretto Moderator
Joined: 29 May 2004 Posts: 3174 Location: Paris
|
Posted: Mon Aug 17, 2015 8:28 pm Post subject: |
|
|
Impossible de remettre la main sur le fichier de conf d'exemple d'une gentoo où j'ai vu ce truc la première fois, mais voici à peu près la même chose dans la doc: https://wiki.gentoo.org/wiki/Handbook:AMD64/Networking/Modular
Quote: | We try and make DHCP relatively agnostic - as such we support the following commands using the dhcp_eth0 variable. The default is not to set any of them:
- release - releases the IP address for re-use
- nodns - don't overwrite /etc/resolv.conf
- nontp - don't overwrite /etc/ntp.conf
- nonis - don't overwrite /etc/yp.conf
|
_________________ -TrueNAS & jails: µ-serv Gen8 E3-1260L, 16Go ECC + µ-serv N40L, 10Go ECC
-Réseau: APU2C4 (OpenWRT) + GS726Tv3 + 2x GS108Tv2 + Archer C5v1 (OpenWRT) |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
|
Back to top |
|
|
El_Goretto Moderator
Joined: 29 May 2004 Posts: 3174 Location: Paris
|
Posted: Fri Aug 21, 2015 8:53 pm Post subject: |
|
|
Raaaah, merci _________________ -TrueNAS & jails: µ-serv Gen8 E3-1260L, 16Go ECC + µ-serv N40L, 10Go ECC
-Réseau: APU2C4 (OpenWRT) + GS726Tv3 + 2x GS108Tv2 + Archer C5v1 (OpenWRT) |
|
Back to top |
|
|
Enlight Advocate
Joined: 28 Oct 2004 Posts: 3519 Location: Alsace (France)
|
Posted: Sun Aug 23, 2015 6:33 pm Post subject: |
|
|
Merci les gars, en configurant comme suit j'ai exactement ce que je voulais!
Code: | config_eth0="dhcp"
dhcp_eth0="release nodns nontp nonis"
dns_servers_eth0="$ip1 $ip2"
|
|
|
Back to top |
|
|
|