LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-11-2008, 12:22 PM   #1
mtess
LQ Newbie
 
Registered: Mar 2008
Posts: 5

Rep: Reputation: 0
NetworkManager & gprs/ppp DNS: after using wlan/eth0, DNS for ppp doesn't work


Hi there,

I am currently using a laptop (running fedora 8), with ethernet/wireless at work, and NetworkManager does a great job for switching from one to another. At home however, I use a gprs phone for my internet connection, and to connect I use pppd, the script works fine. But konqueror (or any other app) doesn't get the proper DNS addresses. I have to manually enter the DNS numbers given by the connect script into the Network settings, and restart my network using service network restart (which I suppose is *not* the right way since network settings seems to deal with ethernet connections only - however it works).

So my obvious question is: what can I do? I already have a shortcut for "pppd call provider", I guess I could add the information to change the DNS info before calling pppd, but I don't really understand how (since in ifconfig ppp and eth0 are quite separate entities). Where *is* the place in fedora where you set the "master" or "current" DNS address (to which konqueror etc refer)?

I looked around to see if ppp can be added to networkmanager, but although I found discussion about it, I didn't find any info about how to do that.
Again I'm glad to have a command line (as I'll just add it to the connect script) to set the DNS (which by the way is static) at each connection...but as I said earlier, I really don't understand where the DNS is set.

Any help (or hint) is greatly appreciated.

Thanks,
mtess
 
Old 03-11-2008, 03:56 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
You could add to the script the ability to change the /etc/resolv.conf file. this is where DNS is saved. I personally do not use NetworkManager but I have several places I connect. I simply bring networking down, replace the needed config files with the files with the correct contents and bring networking backup.

Brian
 
Old 03-12-2008, 05:09 AM   #3
mtess
LQ Newbie
 
Registered: Mar 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks Brian for the info about /etc/resolv.conf - this is one mystery about networking on fedora that is solved

I created a resolv.conf file in my home dir containting the right dns info, and whenever I connect using my phone, this file gets copied into /etc/ and network is restarted, prior to calling pppd.

I still am puzzled about the need to restart the network (and that thing checking for eth0 (taking time)) just for updating dns info.
I wish there was a way of adding ppp connections to networkmanager, would make the whole thing easier!

By the way, when using service network restart, does it execute a couple of ifconfig eth0 up (etc) kind of commands? If yes, service network restart could be bypassed, and only the right command for updating dns info could be used...?
If anyone has some info about this, please let me know!

Thanks again,

mtess
 
Old 03-12-2008, 03:31 PM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
When I bring networking backup I have all files like /etc/sysconfig/network-scripts/ifcfg-eth0, ifcfg-ath0, ifup-wireless, /etc/wpa_supplicant/wpa_supplicant.conf, and /etc/resolv.conf edit to the stat they need to be for that connection. Seems overkill maybe but I know exactly what each file is at the point of restarting the network service. Here is an example of one of my scripts.
Code:
#!/bin/bash
sudo /sbin/service network stop
sudo cp -f /etc/wpa_supplicant/lenard.wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
sudo cp -f /etc/sysconfig/network-scripts/ifup-wireless-nowpa /etc/sysconfig/network-scripts/ifup-wireless
sudo cp -f /etc/sysconfig/network-scripts/dhcp-ifcfg-ath0 /etc/sysconfig/network-scripts/ifcfg-ath0
ping -c2 127.0.0.1 > /dev/null
sudo /sbin/service network start
ping -c2 127.0.0.1 > /dev/null
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf > /etc/sysconfig/network-scripts/scripts/output/netinfo1
/sbin/ifconfig ath0 > /etc/sysconfig/network-scripts/scripts/output/netinfo2
/sbin/iwconfig ath0 > /etc/sysconfig/network-scripts/scripts/output/netinfo3
ping -c2 www.google.com > /etc/sysconfig/network-scripts/scripts/output/netinfo4
cat /etc/sysconfig/network-scripts/scripts/output/netinfo* > /etc/sysconfig/network-scripts/scripts/output/Netinfo
ping -c2 127.0.0.1 > /dev/null
xmessage -center -file /etc/sysconfig/network-scripts/scripts/output/Netinfo
Note I added a line in /etc/init.d/network script to kill wpa_supplicant on stopping the service. Also once everything is setup, copied, and started I run a ping and post to the screen info related to certain files. Just helps to make sure I selected the correct script.

Brian

Last edited by Brian1; 03-12-2008 at 03:32 PM.
 
  


Reply

Tags
dns, gprs, pppd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ppp dialup dns problem (Slackware 9.1) johnMG Linux - Networking 8 05-06-2004 10:09 AM
help getting simple PPP (no LAN) DNS working johnMG Slackware 2 04-19-2004 07:55 PM
PPP and Wrong ISP DNS Allen614 Slackware 1 02-16-2003 11:12 AM
DNS trouble with Dial-in PPP. dannyboy259 Linux - Networking 3 03-21-2002 04:01 PM
DNS on PPP DavidPhillips Linux - General 1 11-02-2001 12:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration