How to ask NetworkManager to just get IPs from DHCP?

Asked by Uqbar

I run GNOME 2.24.1 under Ubuntu 8.10.
I've asked NetworkManager (through the applet v0.7.0) to get from the DHCP only the IP addresses.
There's an ad-hoc action in IPv4 settings->Method.
I do this because I run my own resolver on 127.0.0.1.
Despite this, at reboot I still get the "nornal" behaviour with both IP addresses and the DNS coming from the DHCP server.
What's puzzling is also that the settings I defined disappear when I show them after the reboot.
The thing seems to work only when I unplug and then plug back the Ethernet cable.
Any hint?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu network-manager Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Please open a terminal from Applications → Accessories → Terminal and type

sudo gedit /etc/dhcp3/dhclient.conf

give your user password when requested, you don't see nothing when you type it, then press enter.

Change the prepend line to read:

prepend domain-name-servers 127.0.0.1 ;

save and exit and restart your newortk:

sudo /etc/init.d/networking restart

Hope This Help

Revision history for this message
Uqbar (uqbar) said :
#2

Thanks Marco: your hint works fine.

But it works also when I need to use a full DHCP request/response.
This is why I was hoping to use the nice NetworkManager configuration to create a "network profile".
When I'm allowed to, I prefer to use my own resolver (127.0.0.1). But on some networks I need to use the one provided by DHCP. In this case your suggestion would yield to false "unknown host".

Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#3

So little different question...

Please remove or add a "#" to rem the previuos row from the /etc/dhcp3/dhclient.conf

I found a very handy tool to get your network configured.
Wicd is a different network tool and it have all function you ask.
You can use it on Ubuntu i use it without any issue.

http://wicd.sourceforge.net/ and some screenshot http://wicd.sourceforge.net/screenshot.php

How to install wicd

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you for a password give your user password, you will not see nothing when you type it, then press enter)

wget -q http://apt.wicd.net/wicd.gpg -O - | sudo apt-key add -

Add the wicd repository row to your /etc/apt/sources.list, type:

sudo gedit /etc/apt/sources.list

and add this row:

deb http://apt.wicd.net intrepid extras

save close and exit. Then type:

sudo apt-get update
sudo apt-get install wicd
sudo killall nm-applet

To manually run the wicd-client please press Alt+F2 on an empty desktop and insert this command:

wicd-client

configure your connection. Then reboot your pc.

Hope this helps

Revision history for this message
Uqbar (uqbar) said :
#4

Hi.
I'll give that a try and, if possible, I'll replace the NM applet.

Revision history for this message
Uqbar (uqbar) said :
#5

That's a great piece of software. It solved my problems.

Revision history for this message
Uqbar (uqbar) said :
#6

Thanks marcobra, that solved my question.