J'ai configuré ma carte reseau comme suit (et ca marche) mais lorque je demarre le service NetworkManager, il cherche a me connecter
sur une autre reseau avec une adresse IP differente (169.254.59.61).
Je n'avais pas ce probleme la avec F7.

Quelqu'un a-t-il une idee?

Ma config a la main:
eth0      Link encap:Ethernet  HWaddr 00:15:C5:53:FD:F5  
          inet addr:192.168.1.61  Bcast:192.168.1.63  Mask:255.255.255.224
          inet6 addr: fe80::215:c5ff:fe53:fdf5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9163 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7620 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7331627 (6.9 MiB)  TX bytes:1247685 (1.1 MiB)
          Interrupt:17
Resultat de NetworkManager:
eth0      Link encap:Ethernet  HWaddr 00:15:C5:53:FD:F5  
          inet addr:169.254.59.61  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::215:c5ff:fe53:fdf5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8644 (8.4 KiB)  TX bytes:6322 (6.1 KiB)
          Interrupt:17
Sortie de /var/log/message:
Nov  9 17:18:14 tosca NetworkManager: <info>  starting...
Nov  9 17:18:14 tosca NetworkManager: <info>  Found radio killswitch /org/freedesktop/Hal/devices/dell_wlan_switch
Nov  9 17:18:14 tosca NetworkManager: <info>  eth0: Device is fully-supported using driver 'b44'.
Nov  9 17:18:14 tosca NetworkManager: <info>  (eth0): exporting device as /org/freedesktop/NetworkManager/Device/2
Nov  9 17:18:14 tosca NetworkManager: <info>  Now managing wired Ethernet (802.3) device 'eth0'.
Nov  9 17:18:14 tosca NetworkManager: <info>  Bringing down device eth0
Nov  9 17:18:14 tosca avahi-daemon[2243]: Interface eth0.IPv4 no longer relevant for mDNS.
Nov  9 17:18:14 tosca avahi-daemon[2243]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.61.
Nov  9 17:18:14 tosca avahi-daemon[2243]: Withdrawing address record for fe80::215:c5ff:fe53:fdf5 on eth0.
Nov  9 17:18:14 tosca avahi-daemon[2243]: Withdrawing address record for 192.168.1.61 on eth0.
Nov  9 17:18:16 tosca ntpd[2086]: sendto(212.85.158.10) (fd=22): Network is unreachable
Nov  9 17:18:16 tosca NetworkManager: <info>  Bringing up device eth0
Nov  9 17:18:16 tosca avahi-daemon[2243]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.61.
Nov  9 17:18:16 tosca kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Nov  9 17:18:16 tosca avahi-daemon[2243]: New relevant interface eth0.IPv4 for mDNS.
Nov  9 17:18:16 tosca avahi-daemon[2243]: Registering new address record for 192.168.1.61 on eth0.IPv4.
Nov  9 17:18:16 tosca NetworkManager: <info>  Deactivating device eth0.
Nov  9 17:18:16 tosca avahi-daemon[2243]: Withdrawing address record for 192.168.1.61 on eth0.
Nov  9 17:18:16 tosca avahi-daemon[2243]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.61.
Nov  9 17:18:16 tosca avahi-daemon[2243]: Interface eth0.IPv4 no longer relevant for mDNS.
Nov  9 17:18:16 tosca NetworkManager: <info>  wlan0: Device is fully-supported using driver 'ipw3945'.
Nov  9 17:18:16 tosca NetworkManager: <info>  (wlan0): exporting device as /org/freedesktop/NetworkManager/Device/3
Nov  9 17:18:16 tosca NetworkManager: <info>  Now managing wireless (802.11) device 'wlan0'.
Nov  9 17:18:16 tosca NetworkManager: <info>  Bringing up device wlan0
Nov  9 17:18:16 tosca kernel: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Nov  9 17:18:16 tosca NetworkManager: <info>  Deactivating device wlan0.
Nov  9 17:18:16 tosca NetworkManager: <info>  (eth0) supplicant interface is now in state 2 (from 1).
Nov  9 17:18:16 tosca NetworkManager: <info>  (wlan0) supplicant interface is now in state 2 (from 1).
Nov  9 17:18:17 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:18:19 tosca kernel: b44: eth0: Link is up at 100 Mbps, full duplex.
Nov  9 17:18:19 tosca kernel: b44: eth0: Flow control is off for TX and off for RX.
Nov  9 17:18:19 tosca kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Nov  9 17:18:19 tosca NetworkManager: <info>  SWITCH: no current connection, found better connection 'Auto Ethernet (eth0)'.
Nov  9 17:18:19 tosca NetworkManager: <info>  Activating device eth0
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) started...
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) starting...
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Beginning DHCP transaction.
Nov  9 17:18:19 tosca NetworkManager: <info>  dhclient started with pid 3712
Nov  9 17:18:19 tosca NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Nov  9 17:18:19 tosca dhclient: Internet Systems Consortium DHCP Client V3.0.6-Fedora
Nov  9 17:18:19 tosca dhclient: Copyright 2004-2007 Internet Systems Consortium.
Nov  9 17:18:19 tosca dhclient: All rights reserved.
Nov  9 17:18:19 tosca dhclient: For info, please visit http://www.isc.org/sw/dhcp/
Nov  9 17:18:19 tosca dhclient: 
Nov  9 17:18:19 tosca NetworkManager: <info>  DHCP: device eth0 state changed (null) -> preinit
Nov  9 17:18:19 tosca dhclient: Listening on LPF/eth0/00:15:c5:53:fd:f5
Nov  9 17:18:19 tosca dhclient: Sending on   LPF/eth0/00:15:c5:53:fd:f5
Nov  9 17:18:19 tosca dhclient: Sending on   Socket/fallback
Nov  9 17:18:19 tosca dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Nov  9 17:18:20 tosca ntpd[2086]: sendto(91.121.71.85) (fd=22): Invalid argument
Nov  9 17:18:20 tosca NetworkManager: <WARN>  killswitch_getpower_reply(): Error getting killswitch power: An Error occurred. The Error message is:  #012 Could not open file /sys/devices/platform/dcdbas/smi_data. Check that dcdbas driver is properly loaded..
Nov  9 17:18:21 tosca avahi-daemon[2243]: Registering new address record for fe80::215:c5ff:fe53:fdf5 on eth0.*.
Nov  9 17:18:25 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:18:26 tosca dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Nov  9 17:18:32 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:18:33 tosca dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Nov  9 17:18:40 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:18:41 tosca dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
Nov  9 17:18:48 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:18:55 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:19:01 tosca dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
Nov  9 17:19:03 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:19:04 tosca NetworkManager: <info>  Device 'eth0' DHCP transaction took too long (>45s), stopping it.
Nov  9 17:19:04 tosca NetworkManager: <info>  eth0: canceled DHCP transaction, dhclient pid 3712
Nov  9 17:19:04 tosca NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Timeout) scheduled...
Nov  9 17:19:04 tosca NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Timeout) started...
Nov  9 17:19:04 tosca NetworkManager: <info>  No DHCP reply received.  Automatically obtaining IP via Zeroconf.
Nov  9 17:19:04 tosca NetworkManager: <info>  autoip: Sending probe #0 for IP address 169.254.59.61.
Nov  9 17:19:04 tosca NetworkManager: <info>  autoip: Waiting for reply...
Nov  9 17:19:06 tosca NetworkManager: <info>  autoip: Sending probe #1 for IP address 169.254.59.61.
Nov  9 17:19:06 tosca NetworkManager: <info>  autoip: Waiting for reply...
Nov  9 17:19:08 tosca NetworkManager: <info>  autoip: Sending probe #2 for IP address 169.254.59.61.
Nov  9 17:19:08 tosca NetworkManager: <info>  autoip: Waiting for reply...
Nov  9 17:19:09 tosca NetworkManager: <info>  autoip: Got some data to check for reply packet.
Nov  9 17:19:09 tosca NetworkManager: <WARN>  get_autoip(): autoip: (eth0) recv arp type=2048, op=0, 
Nov  9 17:19:09 tosca NetworkManager: <WARN>  get_autoip():  source = 1.57.192.168 80:11:D1:9C:C0:A8, 
Nov  9 17:19:09 tosca NetworkManager: <WARN>  get_autoip():  target = 5.89.109.254 01:3F:19:F6:19:F6#012
Nov  9 17:19:09 tosca NetworkManager: <info>  autoip: Sending announce #0 for IP address 169.254.59.61.
Nov  9 17:19:09 tosca NetworkManager: <info>  autoip: Waiting for reply...
Nov  9 17:19:10 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:19:12 tosca NetworkManager: <info>  autoip: Sending announce #1 for IP address 169.254.59.61.
Nov  9 17:19:12 tosca NetworkManager: <info>  autoip: Waiting for reply...
Nov  9 17:19:14 tosca ntpd[2086]: sendto(213.186.56.126) (fd=22): Invalid argument
Nov  9 17:19:15 tosca NetworkManager: <info>  autoip: Got some data to check for reply packet.
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip(): autoip: (eth0) recv arp type=2048, op=0, 
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip():  source = 221.17.192.168 31:06:94:B0:48:0E, 
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip():  target = 32.181.130.160 01:3D:01:BB:E5:BB#012
Nov  9 17:19:15 tosca NetworkManager: <info>  autoip: Sending announce #2 for IP address 169.254.59.61.
Nov  9 17:19:15 tosca NetworkManager: <info>  autoip: Waiting for reply...
Nov  9 17:19:15 tosca ntpd[2086]: Deleting interface #6 eth0, 192.168.1.61#123, interface stats: received=25, sent=26, dropped=3, active_time=600 secs
Nov  9 17:19:15 tosca NetworkManager: <info>  autoip: Got some data to check for reply packet.
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip(): autoip: (eth0) recv arp type=2048, op=0, 
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip():  source = 221.17.192.168 31:06:93:85:48:0E, 
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip():  target = 32.181.132.68 01:3D:01:BB:E5:BB#012
Nov  9 17:19:15 tosca NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
Nov  9 17:19:15 tosca NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Timeout) complete.
Nov  9 17:19:15 tosca NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
Nov  9 17:19:15 tosca avahi-daemon[2243]: Withdrawing address record for fe80::215:c5ff:fe53:fdf5 on eth0.
Nov  9 17:19:15 tosca avahi-daemon[2243]: Joining mDNS multicast group on interface eth0.IPv4 with address 169.254.59.61.
Nov  9 17:19:15 tosca avahi-daemon[2243]: New relevant interface eth0.IPv4 for mDNS.
Nov  9 17:19:15 tosca avahi-daemon[2243]: Registering new address record for 169.254.59.61 on eth0.IPv4.
Nov  9 17:19:16 tosca NetworkManager: <info>  Activation (eth0) successful, device activated.
Nov  9 17:19:16 tosca NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
Nov  9 17:19:17 tosca avahi-daemon[2243]: Registering new address record for fe80::215:c5ff:fe53:fdf5 on eth0.*.
Nov  9 17:19:18 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:19:43 tosca kernel:last message repeated 3 times
Nov  9 17:19:43 tosca NetworkManager: <WARN>  nm_signal_handler(): Caught signal 15, shutting down normally.
Nov  9 17:19:43 tosca NetworkManager: <info>  Bringing down device eth0
Nov  9 17:19:43 tosca NetworkManager: <info>  Deactivating device eth0.
Nov  9 17:19:43 tosca avahi-daemon[2243]: Withdrawing address record for 169.254.59.61 on eth0.
Nov  9 17:19:43 tosca avahi-daemon[2243]: Leaving mDNS multicast group on interface eth0.IPv4 with address 169.254.59.61.
Nov  9 17:19:43 tosca avahi-daemon[2243]: Interface eth0.IPv4 no longer relevant for mDNS.
Nov  9 17:19:43 tosca avahi-daemon[2243]: Withdrawing address record for fe80::215:c5ff:fe53:fdf5 on eth0.
Nov  9 17:19:43 tosca NetworkManager: <info>  Deactivating device eth0.
Nov  9 17:19:43 tosca NetworkManager: <info>  Bringing down device wlan0
Nov  9 17:19:43 tosca NetworkManager: <info>  Deactivating device wlan0.
Nov  9 17:19:48 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:20:04 tosca kernel:last message repeated 2 times
Nov  9 17:20:04 tosca system-config-network[3660]: -+ //etc/modprobe.conf #011eth0 alias b44
Nov  9 17:20:04 tosca system-config-network[3660]: chmod 0644 //etc/sysconfig/networking/devices/ifcfg-wlan0.bak
Nov  9 17:20:04 tosca system-config-network[3660]: chmod 0644 //etc/sysconfig/networking/devices/ifcfg-eth0
Nov  9 17:20:04 tosca system-config-network[3660]: mv //etc/resolv.conf //etc/resolv.conf.bak
Nov  9 17:20:04 tosca system-config-network[3660]: ln //etc/sysconfig/networking/profiles//default/resolv.conf //etc/resolv.conf
Nov  9 17:20:11 tosca system-config-network[3660]: -+ //etc/modprobe.conf #011eth0 alias b44
Nov  9 17:20:11 tosca system-config-network[3660]: chmod 0644 //etc/sysconfig/networking/devices/ifcfg-wlan0.bak
Nov  9 17:20:11 tosca system-config-network[3660]: chmod 0644 //etc/sysconfig/networking/devices/ifcfg-eth0
Nov  9 17:20:11 tosca kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Nov  9 17:20:11 tosca kernel: ipw3945: Detected geography ABG (13 802.11bg channels, 23 802.11a channels)
Nov  9 17:20:14 tosca kernel: b44: eth0: Link is up at 100 Mbps, full duplex.
Nov  9 17:20:14 tosca kernel: b44: eth0: Flow control is off for TX and off for RX.
Nov  9 17:20:14 tosca kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Nov  9 17:20:15 tosca avahi-daemon[2243]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.61.
Nov  9 17:20:15 tosca avahi-daemon[2243]: New relevant interface eth0.IPv4 for mDNS.
Nov  9 17:19:15 tosca NetworkManager: <info>  autoip: Got some data to check for reply packet.
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip(): autoip: (eth0) recv arp type=2048, op=0, 
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip():  source = 221.17.192.168 31:06:93:85:48:0E, 
Nov  9 17:19:15 tosca NetworkManager: <WARN>  get_autoip():  target = 32.181.132.68 01:3D:01:BB:E5:BB#012
Nov  9 17:19:15 tosca NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
Nov  9 17:19:15 tosca NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Timeout) complete.
Nov  9 17:19:15 tosca NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
Nov  9 17:19:15 tosca avahi-daemon[2243]: Withdrawing address record for fe80::215:c5ff:fe53:fdf5 on eth0.
Nov  9 17:19:15 tosca avahi-daemon[2243]: Joining mDNS multicast group on interface eth0.IPv4 with address 169.254.59.61.
Nov  9 17:19:15 tosca avahi-daemon[2243]: New relevant interface eth0.IPv4 for mDNS.
Nov  9 17:19:15 tosca avahi-daemon[2243]: Registering new address record for 169.254.59.61 on eth0.IPv4.
Nov  9 17:19:16 tosca NetworkManager: <info>  Activation (eth0) successful, device activated.
Nov  9 17:19:16 tosca NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
j'ai le meme pb
c'est comme ci il passait outre l'IP statique pour prendre une adresse DHCP
Bonsoir,

Avez-vous essayé d'appliquer la démarche décrite ici dans la documentation ?

++
Mathias
j'ai une connexion cable, la doc c'est plus pour le wifi.
Non, pas forcément. Les tests de cette partie du tuto. ont même été menés en premier en Ethernet...
est ce que ca dis quelque chose a quelqu'un?
je ne trouve pas de solution sur internet.🙁
Nov  9 18:07:52 tosca avahi-daemon[2456]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.61.
Nov  9 18:07:52 tosca avahi-daemon[2456]: New relevant interface eth0.IPv4 for mDNS.
Nov  9 18:07:52 tosca avahi-daemon[2456]: Registering new address record for 192.168.1.61 on eth0.IPv4.
Nov  9 18:07:52 tosca NetworkManager: <info>  Deactivating device eth0.
Nov  9 18:07:52 tosca avahi-daemon[2456]: Withdrawing address record for 192.168.1.61 on eth0.
Nov  9 18:07:52 tosca avahi-daemon[2456]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.61.
Nov  9 18:07:52 tosca avahi-daemon[2456]: Interface eth0.IPv4 no longer relevant for mDNS.
salut

il me fait la même chose chez moi

networkmanager est bien configurer , mais pourtant il se connecte uniquement en dhcp:-x
idem pour moi uniquement en dhcp malgre parametrage en ip statique mais des activation : adresses dhcp
C'est pas vraiment la réponse à votre problème, mais si vous configurez votre connexion "à la main" pourquoi vous utilisez NetworkManager ?
La démarche pour faire du static avec NetworkManager est de :
- arrêter les services NetworkManager et NetworkManagerDispatcher
- configurer sa connexion avec system-config-betwork
- redémarrer les services NetworkManager et NetworkManagerDispatcher.

En tt cas, c'est ce qui est écrit ...🙂
proxy wrote:La démarche pour faire du static avec NetworkManager est de :
- arrêter les services NetworkManager et NetworkManagerDispatcher
- configurer sa connexion avec system-config-betwork
- redémarrer les services NetworkManager et NetworkManagerDispatcher.

En tt cas, c'est ce qui est écrit ...🙂
chez moi , ta démarche fonctionne, sauf que la connexion est désactiver par défaut
je dois l activé après chaque démarrage

edit ; j ai du aussi désactiver l applet networkmanager & co dans les programmes lancé a l ouverture de session

l applet de networkmanager , quand il est lancé, m empêche de me connecter en ip static
Chez moi ca ne marche pas.
Je desactive NM et NMDisp. je configure la carte reseau en mode statique avec system-config-network et je redemarre NM. Tout de suite, NM cherche une adresse IP a attibuer a ma carte reseau (169.254.59.61).
je suis dans le meme cas et ca me soule

mon ip de base est 192.168.1.100

et il me la change toujours en 192.168.1.4

je suis obliger de faire à chaque fois

ifconig eth0 192.168.1.100
Bah euh, à toi de configurer ta box pour qu'elle assigne telle adresse IP à ton adresse MAC.
c'est le netwok manager qui pose probleme

desactivez le (si vous n'avez pas le wifi) et c'est bon
neowdj wrote:c'est le netwok manager qui pose probleme

desactivez le (si vous n'avez pas le wifi) et c'est bon
NetworkManager ne sert pas que pour le Wifi. Théoriquement, la démarche que j'ai exposé + haut fonctionne pour du statique , mais y a peut être un bug. Je n'ai pas testé.

Si vous avez un PC fixe, ne l'activez pas, par un contre pour un laptop itinérant , c'est vraiment génial.
De plus, vous pouvez personnaliser votre connexion en mettant un script dans /etc/NetworkManager/dispatcher.d/.

Pratique pour par exemple, démarrer des services uniquement quand connecté à un réseau particulier.
Tu peux nous donner un exemple de script que tu mets dans /etc/NetworkManager/dispatcher.d/?
betsubetsu wrote:Tu peux nous donner un exemple de script que tu mets dans /etc/NetworkManager/dispatcher.d/?
J'ai un script qui modifie mon fichier hosts pour y mettre mon IP et mon hostname, puis suivant le réseau sur lequel je suis connecté, je démarre des services ou pas.
#!/bin/sh

#===========================================================================================#
getIp() {
ip=$(ifconfig | grep -a1 ${1} | grep inet | cut -d ':' -f2 | cut -d ' ' -f1)
echo "${ip}"
}

#===========================================================================================#
isInterfaceActive() {
ip=$(getIp "${1}")
if [ "${ip}" != "" ] ; then
echo "1"
else
echo "0"
fi
}

#===========================================================================================#
setHostname() {
ip=$(getIp "${1}")
echo "Setting ${HOSTNAME} ${ip}"
cat /etc/hosts | grep -v "${HOSTNAME}" > /tmp/hosts
echo "${ip} ${HOSTNAME}" >> /tmp/hosts

if [ "${ip}" = "192.168.0.100" ] ; then
echo "Starting SAMBA"
service samba restart
echo "Adding OpenDNS hosts"
echo "nameserver 208.67.220.220" >> /etc/resolv.conf
echo "nameserver 208.67.222.222" >> /etc/resolv.conf
fi
cp -p /tmp/hosts /etc/.
}


ethernet=$(grep -a2 Ethernet /etc/sysconfig/hwconf | grep device | cut -d " " -f2)
wireless=$(grep -a2 Wireless /etc/sysconfig/hwconf | grep device | cut -d " " -f2)
for eth in "${ethernet}" "${wireless}" "${loopback}"
do
if [ $(isInterfaceActive "${eth}") -ne 0 ] ; then
echo "$eth is active. Using it"
setHostname "${eth}"
exit 0
fi
done
Hum, t'as checké ton resolv.conf?

Si tu te connectes 10 fois à ton réseau, j'ai peur que tes dns soient déclarés 10 fois.