LinuxQuestions.org
Visit Jeremy's Blog.
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 02-25-2006, 06:37 PM   #1
Juzzam
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Rep: Reputation: 0
Unhappy How to change DNS in Linux for ppp device


I'm trying to setup my RHEL 4 laptop to dial-up using my cellphone (Nokia 7610). The phone shows up as a standard serial modem on /dev/ttyACM0 when I plug it in via USB.

When I try to dial-in with pppd I think it connects, because it gives me an IP Address and DNS:

Code:
local  IP address 10.178.162.86
remote IP address 10.6.6.6
primary   DNS address 66.94.9.120
secondary DNS address 66.94.25.120
I can ping IP addresses, but I can't ping domain names. For example, I cannot ping yahoo.com, but I can ping its real IP address (216.109.112.135). When I do a ./route I get the following:
Code:
Kernel IP routing table
Destination	Gateway         Genmask         Flags Metric Ref    Use Iface
10.6.6.6        *               255.255.255.255 UH    0      0        0 ppp0
default         10.6.6.6        0.0.0.0         UG    0      0        0 ppp0
Notice that it has 10.6.6.6 as the gateway. Shouldn't it be 66.94.9.120 - the primary DNS listed by pppd? I *can* ping the primary DNS IP (66.94.9.120).

Is there linux networking command I need to run to correct the DNS?

I really appreciate the help - I've been wrestling with this for weeks =(

More Details:
I know this can work because it works great under windows. In windows I go through the regular dialup settings except I leave the user/password blank, dial *99#, and put the following in as an init string (in advanced modem properties):
at+cgdcont=1,"IP","internet2.voicestream.com"

I know very little about pppd. I got the scripts I'm using from here: linuxdevcenter.com/pub/a/linux/2004/02/05/linux_cellular.html

To try to connect, I run /usr/sbin/pppd call tmobile

My pppd script located at /etc/ppp/peers/tmobile is as follows:
Code:
/dev/ttyACM0 
115200
defaultroute  # use the cellular network for the default route
usepeerdns    # use the DNS servers from the remote network
nodetach      # keep pppd in the foreground
crtscts       # hardware flow control
lock          # lock the serial port
noauth        # don't expect the modem to authenticate itself
local         # don't use Carrier Detect or Data Terminal Ready
debug 
connect    "/usr/sbin/chat -v -f /etc/chatscripts/tmobile-connect"
My chat script located at /etc/chatscripts/tmobile-connect is as follows:
Code:
TIMEOUT 10
ABORT   'BUSY'
ABORT   'NO ANSWER'
ABORT   'ERROR'
SAY     'Starting GPRS connect script\n'

# Get the modem's attention and reset it.
""      'ATZ'

# E0=No echo, V1=English result codes
OK      'ATE0V1'

# Set Access Point Name (APN)
SAY     'Setting APN\n'
OK      'AT+CGDCONT=1,"IP","internet2.voicestream.com"'

# Dial the number
ABORT   'NO CARRIER'
SAY     'Dialing...\n'
OK      'ATD*99#'
CONNECT ''
Finally, the output is as follows:
Code:
[root@bobpete sbin]# ./pppd call tmobile
Starting GPRS connect script
Setting APN
Dialing...
Serial connection established.
using channel 6
Using interface ppp0
Connect: ppp0 <--> /dev/ttyACM0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x89e96abe> <pcomp> <accomp>]
rcvd [LCP ConfRej id=0x1 <magic 0x89e96abe> <pcomp> <accomp>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0>]
rcvd [LCP ConfReq id=0x0 <auth pap> <mru 1500> <asyncmap 0xa0000>]
No auth is possible
sent [LCP ConfRej id=0x0 <auth pap>]
rcvd [LCP ConfReq id=0x1 <mru 1500> <asyncmap 0xa0000>]
sent [LCP ConfAck id=0x1 <mru 1500> <asyncmap 0xa0000>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [IPCP ConfReq id=0x0 <addr 10.6.6.6>]
sent [IPCP ConfAck id=0x0 <addr 10.6.6.6>]
rcvd [LCP ProtRej id=0x0 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [IPCP ConfNak id=0x2 <addr 10.172.130.252> <ms-dns1 66.94.9.120> <ms-dns3 66.94.25.120>]
sent [IPCP ConfReq id=0x3 <addr 10.172.130.252> <ms-dns1 66.94.9.120> <ms-dns3 66.94.25.120>]
rcvd [IPCP ConfAck id=0x3 <addr 10.172.130.252> <ms-dns1 66.94.9.120> <ms-dns3 66.94.25.120>]
not replacing existing default route to eth0 [192.168.0.1]
local  IP address 10.172.130.252
remote IP address 10.6.6.6
primary   DNS address 66.94.9.120
secondary DNS address 66.94.25.120

Last edited by Juzzam; 02-25-2006 at 08:20 PM.
 
Old 02-25-2006, 10:59 PM   #2
Juzzam
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
It's working - I'm writing this reply via my cellphone connection. All I had to do was edit /etc/resolve.conf and replace nameserver 192.168.0.1 with nameserver 66.94.9.120 (Primary DNS given by pppd).

Anyone know of a way to script it so the resolve.conf file gets updated automatically?
 
  


Reply



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
irda - GPRS - pppd - DNS problem, need help! lucastic Linux - Networking 2 11-02-2011 12:11 AM
Cannot find DNS on RedHat 8.0 dialup artemis Linux - Networking 3 06-01-2004 08:06 AM
ppp dialup dns problem (Slackware 9.1) johnMG Linux - Networking 8 05-06-2004 10:09 AM
DNS lookups not working on dialup connection foboldfky Linux - Networking 5 12-03-2003 09:53 AM
BTinternet DNS setting & pppd fin Linux - Networking 2 10-18-2002 02:08 PM

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

All times are GMT -5. The time now is 07:41 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