PDA

View Full Version : how to disable dhclient?


Hades0523
17th February 2008, 05:30 PM
I wanna disable dhclient that I can use static IP address.
I made a static IP address in 'ifcfg-wlan0' for wlan0,but it not works.I need to ifdown/ifup to make it works manually.unfortunately I have to do this everyboot that I can use my static IP address.need you help please.

Brian1
17th February 2008, 05:51 PM
Post contents of current ifcfg-wlan0 and /etc/rc.local

Brian

stevea
17th February 2008, 06:13 PM
Are you using "NetworkManager"(NM) by any chance ? NM automatically spawns dhcp - no alternatives, although static IPs will be supported in some future release.

Brian1
17th February 2008, 06:33 PM
Ah the dreaded NetworkManager. I always forget that since I never liked it to begin with.

Brian

Hades0523
17th February 2008, 06:36 PM
Post contents of current ifcfg-wlan0 and /etc/rc.local

Brian
post here

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
ONBOOT=no
USERCTL=no
PEERDNS=yes
IPV6INIT=no
MTU=1500
GATEWAY=192.168.1.1
TYPE=Wireless
DEVICE=wlan0
HWADDR=00:11:f5:**:**:76
BOOTPROTO=static
NETMASK=255.255.255.0
DHCP_HOSTNAME=
IPADDR=192.168.1.150
DOMAIN=
ESSID=Kamui
CHANNEL=6
MODE=
RATE=


[root@localhost ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
nohup /usr/bin/pipclient -w /usr/bin &

to stevea: yes I using "NetworkManager",but I dont how can I online without NetworkManager.

Brian1
17th February 2008, 07:22 PM
You have ONBOOT set to no and needs to be yes.
Also set DHCPPROTO to none

ONBOOT=yes
DHCPPROTO=none

And if you have a wired nic that is say eth0 the edit ifcfg-eth0 to have ONBOOT=no. One can really only have a single interface up with a defined gateway unless routing commands are set.

Brian

Hades0523
17th February 2008, 07:33 PM
wow!cool!I did it.Thanks a lot dear Brian1.You did me a huge favor.

Brian1
17th February 2008, 07:52 PM
Glad to be of help.

Brian