I am running Fedora Core 3 and attempting to get a connection to the
internet using wvdial.
Everything is OK, except that I have to manually edit the
/etc/resolv.conf file, after the connection is established, but before
I start browsing.
I have checked and usepeerdns is specified on the pppd command line
generated by wvdial. According to the pppd documentation, this should
rewrite the /etc/resolv.conf.
My system information and config files is below
Nick Bishop
============================
[root@jervois /root]# uname -a
Linux jervois 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386
GNU/Linux
[root@jervois /root]# wvdial --help
WvDial 1.54.0: Copyright (c) 1997-2002 Net Integration Technologies,
Inc.
....
[root@jervois /root]# pppd --help
pppd version 2.4.2
.....
[Adding the dump option to /etc/ppp/peers/wvdial, read by pppd, gives
this in /var/log/messages]
Sep 5 09:11:16 jervois kernel: PPP generic driver version 2.4.2
Sep 5 09:11:16 jervois pppd[2374]: pppd options in effect:
Sep 5 09:11:16 jervois pppd[2374]: debug # (from
/etc/ppp/peers/w
vdial)
Sep 5 09:11:16 jervois pppd[2374]: -detach # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: idle 0 # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: logfd 6 # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: dump # (from
/etc/ppp/peers/w
vdial)
Sep 5 09:11:16 jervois pppd[2374]: noauth # (from
/etc/ppp/peers/w
vdial)
Sep 5 09:11:16 jervois pppd[2374]: name jervois # (from
/etc/ppp
/peers/wvdial)
Sep 5 09:11:16 jervois pppd[2374]: user m00566 # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: usehostname # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: remotename * # (from
command
line)
Sep 5 09:11:16 jervois pppd[2374]: 115200 # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: lock # (from
/etc/ppp/options
)
Sep 5 09:11:16 jervois pppd[2374]: record /root/Internet/jervois.log
# (from /etc/ppp/peers/wvdial)
Sep 5 09:11:16 jervois pppd[2374]: crtscts # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: modem # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: noipdefault # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: defaultroute # (from
command
line)
Sep 5 09:11:16 jervois pppd[2374]: usepeerdns # (from command
line)
Sep 5 09:11:16 jervois pppd[2374]: pppd 2.4.2 started by root, uid 0
Sep 5 09:11:17 jervois pppd[2374]: Using interface ppp0
Sep 5 09:11:17 jervois pppd[2374]: Connect: ppp0 <--> /dev/pts/2
Sep 5 09:11:18 jervois pppd[2374]: Remote message: Login ok
Sep 5 09:11:18 jervois pppd[2374]: PAP authentication succeeded
Sep 5 09:11:18 jervois kernel: PPP Deflate Compression module
registered
Sep 5 09:11:19 jervois pppd[2374]: Deflate (15) compression enabled
Sep 5 09:11:19 jervois pppd[2374]: local IP address 203.166.125.18
Sep 5 09:11:19 jervois pppd[2374]: remote IP address 203.166.125.200
Sep 5 09:11:19 jervois pppd[2374]: primary DNS address
203.166.125.195
Sep 5 09:11:19 jervois pppd[2374]: secondary DNS address
203.166.125.194
[root@jervois /root]# cat /etc/ppp/options
lock
[root@jervois /root]# cat /etc/ppp/peers/wvdial
noauth
name wvdial
usepeerdns
record /root/Internet/jervois.log
debug
[root@jervois /root]# ps -ef | grep '[p]ppd'
root 2550 2549 0 09:58 pts/1 00:00:00 /usr/sbin/pppd 115200
modem crtscts defaultroute usehostname -detach user m00566 noipdefault
call wvdial usepeerdns idle 0 logfd 6 remotename *
root 2555 2550 0 09:58 pts/1 00:00:31 /usr/sbin/pppd 115200
modem crtscts defaultroute usehostname -detach user m00566 noipdefault
call wvdial usepeerdns idle 0 logfd 6 remotename *
[root@jervois /root]# cat /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyS1
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 L0 M2 S10=50 S12=150 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
# The ISP is Xpress64, in Melbourne, Australia.
Phone = 90113222
Username = m00566
# The below is not real.
Password = IaintTellingU
Auto Reconnect = off
Dial Attempts = 2
Stupid Mode = on
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
DEBUG=yes
DEVICE=ppp0
WVDIALSECT=MyISP
MODEMPORT=/dev/ttyS4
LINESPEED=115200
PAPNAME=myLogin
USERCTL=yes
ONBOOT=yes
PERSIST=no
DEFROUTE=yes
#PEERDNS=yes <---<<<1
PEERDNS=no <---<<<2
#DEMAND=no
DEMAND=yes
IDLETIMEOUT=600
TYPE=Modem
IPADDR=123.456.789.012
BOOTPROTO=none
NETMASK=255.255.255.255
CCP=off
PC=off
AC=off
BSDCOMP=off
VJ=off
VJCCOMP=off
PROVIDER=MyISP
MODEMNAME=Modem0
What you probably want is a line like <---<<<1 (without the # sign),
not one like <---<<<2
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 08:05:00 up 82 days, 2:01, 4 users, load average: 5.22, 5.19, 4.69
>I am running Fedora Core 3 and attempting to get a connection to the
>internet using wvdial.
wvdial is a poorly designed "helper", but if it's working for you, that's
fine.
>I have checked and usepeerdns is specified on the pppd command line
>generated by wvdial. According to the pppd documentation, this should
>rewrite the /etc/resolv.conf.
You wanna check that again.
usepeerdns
Ask the peer for up to 2 DNS server addresses. The
addresses supplied by the peer (if any) are passed
to the /etc/ppp/ip-up script in the environment
variables DNS1 and DNS2, and the environment vari-
able USEPEERDNS will be set to 1. In addition,
pppd will create an /etc/ppp/resolv.conf file con-
----------------------------------^^^^^^^^^^^^^^^^^^^^
taining one or two nameserver lines with the
address(es) supplied by the peer.
/etc/ppp/resolv.conf != /etc/resolv.conf
If you must use this mode, you have several options. You could use
/etc/ppp/ip-up (Red Hat wants you to create and use /etc/ppp/ip-up.local
instead) to copy /etc/ppp/resolv.conf to /etc/resolv.conf (which would
occur when the link comes up), and use /etc/ppp/ip-down.local to change
/etc/resolv.conf back to the non-connected configuration, or have the
ip.up.local script edit /etc/resolv.conf, or remove /etc/resolv.conf and
replace it with a soft link to /etc/ppp/resolv.conf.
>[root@jervois /root]# cat /etc/wvdial.conf
>Init1 = ATZ
>Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 L0 M2 S10=50 S12=150 +FCLASS=0
Unless you know exactly what your particular modem does with the ATZ
command (reset to "some" condition - but what?), you should be using
the string that your modem manufacturer recommends (usually AT&F0, but
may be AT&F1). The useless crap in the second string is not needed...
but why do you have the speaker always on (M2) but volume at minimum
(L0)?
Otherwise, there doesn't appear to be a problem with your setup.
Old guy
>Hi,
>I am running Fedora Core 3 and attempting to get a connection to the
>internet using wvdial.
>Everything is OK, except that I have to manually edit the
>/etc/resolv.conf file, after the connection is established, but before
>I start browsing.
>I have checked and usepeerdns is specified on the pppd command line
>generated by wvdial. According to the pppd documentation, this should
>rewrite the /etc/resolv.conf.
No, you didi not read the documentation.
pppd rewrites /etc/ppp/resolv.conf. It is up to you (or more likely a line
in the script /etc/ppp/ipup) to get that info into /etc/resolv.conf
> usepeerdns
> Ask the peer for up to 2 DNS server addresses. The
> addresses supplied by the peer (if any) are passed
> to the /etc/ppp/ip-up script in the environment
> variables DNS1 and DNS2, and the environment vari-
> able USEPEERDNS will be set to 1. In addition,
> pppd will create an /etc/ppp/resolv.conf file con-
> ----------------------------------^^^^^^^^^^^^^^^^^^^^
> taining one or two nameserver lines with the
> address(es) supplied by the peer.
>
> /etc/ppp/resolv.conf != /etc/resolv.conf
Yes, I noticed my mistake, but the /etc/ppp/resolv.conf is not being
created. If it was, then I'd know what to do.
> why do you have the speaker always on (M2) but volume at minimum
> (L0)?
I was also diagnosing a random disconnect problem at the time. Since
then I've put the modem in the rubbish bin, put another modem in, and
switched the speaker off (L0 M1 or M0).
Nick Bishop
-----
Kill Bill - sounds like a good movie for a windows hater.
-oOo-
> That is not where the problem is. Look at /etc/sysconfig/network-scripts for
> the file for your ISP. Mine is like this (slight obfuscation):
>
> # Please read /usr/share/doc/initscripts-*/sysconfig.txt
> # for the documentation of these parameters.
...
> #PEERDNS=yes <---<<<1
> PEERDNS=no <---<<<2
>
> What you probably want is a line like <---<<<1 (without the # sign),
> not one like <---<<<2
>
This file doesn't appear to exist on my system. But I'll mull over the
sysconfig.txt doc-file and come back. You may have cracked the
problem.
The other two posters make valid points, re /etc/ppp/resolv.conf, but
yes, I did check that, too. Apologies.
Nick Bishop
-----
email replies ignored.
-----
When all else fails, give up.
-oOo-
>
> Moe Trin wrote:
>
>> usepeerdns
>> Ask the peer for up to 2 DNS server addresses. The
>> addresses supplied by the peer (if any) are passed
>> to the /etc/ppp/ip-up script in the environment
>> variables DNS1 and DNS2, and the environment vari-
>> able USEPEERDNS will be set to 1. In addition,
On fedora systems, /etc/ppp/ifup is called with these variables, and
this script calls a script in /etc/sysconfig/network-scripts to do the
/etc/resolv.conf rewriting. The way it is called is a bit convoluted,
but you will find out. The actual code is in the file ifup-post.
-Enrique
>Yes, I noticed my mistake, but the /etc/ppp/resolv.conf is not being
>created. If it was, then I'd know what to do.
I've only played with 'usepeerdns' a few times, as two of the ISPs I
use don't support this mode. I use a case statement in the ip-up file
based on the IP addresses of the peer to decide which manually created
resolv.conf file to copy over /etc/resolv.conf - something like
case "$5" in
12.34.56.78)
/bin/cp /etc/ppp/isp1.resolv.conf /etc/resolv.conf
;;
23.45.67.89)
/bin/cp /etc/ppp/isp2.resolv.conf /etc/resolv.conf
;;
esac
I don't know why your ppp daemon isn't creating the file. Does it run
/etc/ppp/ip-up (as mentioned, RH wants you to use /etc/ppp/ip-up.local)
when the like comes up? Try adding a line to the beginning of ip-up
that says
/bin/echo "$DNS1" \\n"$DNS2" > /tmp/foo
and see if that sticks the two DNS IPs into that file.
>I was also diagnosing a random disconnect problem at the time. Since
>then I've put the modem in the rubbish bin, put another modem in, and
>switched the speaker off (L0 M1 or M0).
One of the ISPs I use has a crappy phone bank, and they can never seem
to identify which it is, but when I dial, I can hear the modems restart
negotiations several times before a CONNECT. I know that the connection
will then be slow because of lots of errors and retrains. When I hear this,
I automatically reach over, and kill/restart the connection.
Old guy
I had problems running Ubuntu Live cd using the pppoeconf to configure my
adsl link. Everything goes just fine, he asks whether he should write the
DNS addresses he obtains automatically into /etc/resolv.conf, connection is
established. I could ping by ip address, nslookup worked fine when I
manually enter the DNS address, but I could surf or ping by hostname.
Then I checked /etc/resolv.cong and it was empty. As it turned out, the
actual DNS addresses were written into /etc/ppp/resolv.conf. Once I copied
the file into /etc/ or manually edited the one already there, everything
worked fine.
As I said, might not be relevant for you, but in any case do a "find / -name
resolv.conf" to see if resolv.conf with DNS addresses is created somewhere
else, not /etc.
> In the Usenet newsgroup comp.os.linux.setup, in article
> <1126074015....@g43g2000cwa.googlegroups.com>, Nick Bishop wrote:
>
> >Yes, I noticed my mistake, but the /etc/ppp/resolv.conf is not being
> >created. If it was, then I'd know what to do.
>
> I don't know why your ppp daemon isn't creating the file. Does it run
> /etc/ppp/ip-up (as mentioned, RH wants you to use /etc/ppp/ip-up.local)
It seems to execute /etc/ppp/ip-up. This is what I did to get the
/etc/resolv.conf rewrite working ...
1. Inserted "ippparam ppp0" in /etc/ppp/peers/wvdial
2. Created a file /etc/sysconfig/network-scripts/ifcfg-ppp0 with
PEERDNS=yes amongst other stuff
3. Create a blank /etc/resolv.conf (off-line). This gets swapped out
for a good resolv.conf when the ppp comes up, and gets swapped back
when it disconnects.
It's not quite the sort of behaviour I expected from the combination of
wvdial/pppd. Certainly the need to create the ifcfg-ppp0 as above is
not documented anywhere in the man pages for wvdial or pppd.
I will say that the wvdial is convenient when I am dealing with modems
from computer scrap which I don't know much about. However, I will
move away from wvdial, coz that's displaying weird behaviour, if you
put in some [Dialer blah] sections.
The other thing is that I will commission a caching name-server soon,
so I will modify the ifup.local script to alter the "forwarders { ...
};" statement using the $DNS{1,2} variables.
Nick Bishop
-----
Email replies ignored.
-----
Seen in Vermont South (Melbourne, Australia): Custom registration plate
"GNU"
-oOo-
>Moe Trin wrote:
>> In the Usenet newsgroup comp.os.linux.setup, in article
>> <1126074015....@g43g2000cwa.googlegroups.com>, Nick Bishop wrote:
>>
>> >Yes, I noticed my mistake, but the /etc/ppp/resolv.conf is not being
>> >created. If it was, then I'd know what to do.
>>
>> I don't know why your ppp daemon isn't creating the file. Does it run
>> /etc/ppp/ip-up (as mentioned, RH wants you to use /etc/ppp/ip-up.local)
>It seems to execute /etc/ppp/ip-up. This is what I did to get the
>/etc/resolv.conf rewrite working ...
>1. Inserted "ippparam ppp0" in /etc/ppp/peers/wvdial
>2. Created a file /etc/sysconfig/network-scripts/ifcfg-ppp0 with
>PEERDNS=yes amongst other stuff
>3. Create a blank /etc/resolv.conf (off-line). This gets swapped out
>for a good resolv.conf when the ppp comes up, and gets swapped back
>when it disconnects.
>It's not quite the sort of behaviour I expected from the combination of
>wvdial/pppd. Certainly the need to create the ifcfg-ppp0 as above is
>not documented anywhere in the man pages for wvdial or pppd.
That is because it is a redhat specific thing, and is NOT needed. Rather
you can just put
usepeerdns
into /etc/ppp/options
unless redhat has really screwed up ppp (which they have done in the past).
>I will say that the wvdial is convenient when I am dealing with modems
>from computer scrap which I don't know much about. However, I will
>move away from wvdial, coz that's displaying weird behaviour, if you
>put in some [Dialer blah] sections.
When it works wvdial is great. When it does it, it is poor-- poorly
documented and very poor to debug.
>The other thing is that I will commission a caching name-server soon,
>so I will modify the ifup.local script to alter the "forwarders { ...
>};" statement using the $DNS{1,2} variables.
That is what ip-up (or ip-up.local under redhat/madrake) is for.
>"Nick Bishop" <nick...@yahoo.com.au> writes:
>>Moe Trin wrote:
^^^^^^^ doesn't
Somehow my fingers followed the sound rather than the sense.
Can't see the first posts in the thread so apologies if this has been
said already.
I use a little executable script in /etc/ppp/ip-up.d/00-dns-up along with
pon <provider name> and poff. Ownerships may need adjusting for your setup.
Original script courtesy of those very nice people at Debian http://www.debian.org
----- script follows -----
#!/bin/bash
#
# 00-dns-up sets up /etc/resolv.conf for the provider being connected to.
# In conjunction with pppd's usepeerdns option it also handles dynamic dns.
# It expects to be passed the provider name in PPP_IPPARAM.
PROVIDER="$PPP_IPPARAM"
ETC="/etc"
PPPRESOLV="$ETC/ppp/resolv"
TEMPRESOLV="$ETC/resolv.conf.ppp.temp$$"
RESOLVBAK="$ETC/resolv.conf.ppp.bak"
RESOLVCONF="$ETC/resolv.conf"
# We better not do anything if resolv.conf.bak already exists.
test -f "$RESOLVBAK" && exit 0
# Put the resolv.conf for this provider (if it exists) in a temp file.
# If we are using dynamic dns it will be empty or contain any resolver
# options the user added. Otherwise it will be a complete resolv.conf for
# this provider.
test -f "$PPPRESOLV/$PROVIDER" && cat $PPPRESOLV/$PROVIDER > $TEMPRESOLV
# USEPEERDNS, DNS1, and DNS2 are variables exported by pppd. Do we have
# usepeerdns and a couple of nameservers? If so, put a couple of
# nameserver lines in the temp file.
if [ "$USEPEERDNS" ] && [ "$DNS1" ] ; then
echo -e "\nnameserver $DNS1" >> $TEMPRESOLV
if [ "$DNS2" ] ; then
echo -e "\nnameserver $DNS2" >> $TEMPRESOLV
fi
fi
# If we haven't created TEMPRESOLV by now, just exit.
test -f $TEMPRESOLV || exit 0
# Back up resolv.conf.
cp $RESOLVCONF $RESOLVBAK
# And replace it with the new resolv.conf from the temp file.
mv $TEMPRESOLV $RESOLVCONF
chown root:dip $RESOLVCONF
chmod 644 $RESOLVCONF
exit 0
# End /etc/ppp/ip-up.d/00-dns-up
----- end of script -----
--
Email: Martin Fenelon <fenm at freeuk dot com>
> 11 Sep 2005 10:47 UTC, Nick Bishop typed:
> > It seems to execute /etc/ppp/ip-up. This is what I did to get the
> > /etc/resolv.conf rewrite working ...
> >
> > 1. Inserted "ippparam ppp0" in /etc/ppp/peers/wvdial
> > 2. Created a file /etc/sysconfig/network-scripts/ifcfg-ppp0 with
> > PEERDNS=yes amongst other stuff
> > 3. Create a blank /etc/resolv.conf (off-line). This gets swapped out
> > for a good resolv.conf when the ppp comes up, and gets swapped back
> > when it disconnects.
>
> Can't see the first posts in the thread so apologies if this has been
> said already.
Try this: http://shorterlink.com/?RY3D48
(expands to
http://groups.google.com.au/group/comp.os.linux.setup/browse_thread/thread/54db1eb90c05ab00/68279c61226d7c03?lnk=arm&fwc=1
)
No I haven't seen this before, it looks quite inspiring, even if it's
becoming a moot point.
Nick Bishop
-----
TRUE! Street corner - Cummings Road and Seaman Avenue
-oOo-
> "Nick Bishop" <nick...@yahoo.com.au> writes:
>
> >> >Yes, I noticed my mistake, but the /etc/ppp/resolv.conf is not being
> >> >created. If it was, then I'd know what to do.
> >>
>
> >It's not quite the sort of behaviour I expected from the combination of
> >wvdial/pppd. Certainly the need to create the ifcfg-ppp0 as above is
> >not documented anywhere in the man pages for wvdial or pppd.
>
>
> That is because it is a redhat specific thing, and is NOT needed. Rather
> you can just put
> usepeerdns
> into /etc/ppp/options
> unless redhat has really screwed up ppp (which they have done in the past).
Found it (by luck)!!!
/var/run
It was creating the file in /var/run/ppp/resolv.conf - Yes, a screwup
of sorts ... they (Redhat?) change the exe, but not the man page.
Another thing - I've now decommissioned wvdial in favour of a chat
script called from the connect script in pppd - done for a variety of
reasons:
a. I can start it as non-root
b. In another part of that connect script, I can implement crude call
logging for the user's info
c. I can have choices of call-normal or call-quiet (M1 or M0 on the
modem speaker) - the equivalent functionality on wvdial seems to be
broken
Nick Bishop
-----
Examination rules, Canterbury University (Christchurch, NZ) 1986
"Candidates must be suitably dressed"
-oOo-