Bug 517470 - wvdial pppd not updating /etc/resolv.conf when invoked on USB modem
Summary: wvdial pppd not updating /etc/resolv.conf when invoked on USB modem
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: ppp
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jiri Skala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 517294
TreeView+ depends on / blocked
 
Reported: 2009-08-14 08:44 UTC by Richard Chan
Modified: 2014-11-09 22:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-26 20:22:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 743028 0 unspecified CLOSED wvdial does not update /etc/resolv.conf 2021-02-22 00:41:40 UTC

Internal Links: 743028

Description Richard Chan 2009-08-14 08:44:09 UTC
Description of problem:

Run wvdial / pppd to get Internet connection via a modem (USB /dev/ttyACM0).
IP address, DNS retrieved from ISP but /etc/resolv.conf not updated. Result: no name resolution possible.

Version-Release number of selected component (if applicable):


How reproducible:




Steps to Reproduce:
1. Connect a Nokia 3G/HSDPA handset by USB and it appears as a /dev/ttyACM0 modem
2. pppd /dev/ttyACM0 460800 modem defaultroute usepeerdns connect <chat script>
3. 
  
Actual results:
1. Net device, default route, IP address, all installed properly. DNS server retrieved from ISP
2. /etc/resolv.conf is not updated
2. 


Expected results:
/etc/resolv.conf updated so DNS works.

Additional info:
/etc/ppp/ip-up called with 5 args
ppp0 /dev/ttyACM0 460800 119.234.145.157 10.6.6.6
Note: 5 arguments ONLY, so /etc/sysconfig/network-scripts/ifup-post is NOT invoked, so no /etc/resolv.conf updating.
/etc/ppp/ip-up expects 6 arguments, and looks for the file /etc/sysconfig/network-scripts/ifcfg-XXXX (if the 6th argument is XXXX)

If I 'trick' the script by creating a dummy file /etc/sysconfig/network-scripts/ifcfg- containing
PEERDNS=yes
DEFROUTE=yes

/etc/ppp/ip-up sees the existence of this file and then does invoke .../ifup-post.

Comment 1 Jiri Skala 2009-09-29 19:19:44 UTC
I tested it with Nokia and it works for me but ...:

# pppd call <script> (script in /etc/ppp/peers/<script>)

Script have to contain 'usepeerdns' option

The /etc/ppp/ip-up should call /etc/ppp/ip-up.local

My ip-up.local (copied from /usr/share/doc/ppp-2.4.4/scripts/ip-up.local.add and modified):
if [ -n "$USEPEERDNS" -a -f /var/run/ppp/resolv.conf ]; then
	rm -f /var/run/ppp/resolv.prev
	if [ -f /etc/resolv.conf ]; then
		cp /etc/resolv.conf /var/run/ppp/resolv.prev
		rscf=/var/run/ppp/resolv.new
		cp /var/run/ppp/resolv.conf $rscf
		grep domain /var/run/ppp/resolv.prev >> $rscf
		grep search /var/run/ppp/resolv.prev >> $rscf
		grep nameserver /var/run/ppp/resolv.prev >> $rscf
		change_resolv_conf $rscf
		rm -f $rscf
	else
		change_resolv_conf /var/run/ppp/resolv.conf
	fi
fi

The resolv.conf is updated. The example of ip-up.local is quick test. This is not a dogma. :-)

Jiri

Comment 2 Jiri Skala 2009-11-26 20:22:59 UTC
(In reply to comment #0)
> Additional info:
> /etc/ppp/ip-up called with 5 args
> ppp0 /dev/ttyACM0 460800 119.234.145.157 10.6.6.6
> Note: 5 arguments ONLY, so /etc/sysconfig/network-scripts/ifup-post is NOT
> invoked, so no /etc/resolv.conf updating.
> /etc/ppp/ip-up expects 6 arguments, and looks for the file
> /etc/sysconfig/network-scripts/ifcfg-XXXX (if the 6th argument is XXXX)
> 
> If I 'trick' the script by creating a dummy file
> /etc/sysconfig/network-scripts/ifcfg- containing
> PEERDNS=yes
> DEFROUTE=yes
> 
> /etc/ppp/ip-up sees the existence of this file and then does invoke
> .../ifup-post.  

You can define the sixth parameter of ip-up via option
ipparam <your_definition>

usepeerdns is mandatory option to generate resolv.conf in /etc... that is used by script ip-up.local to update resolv.conf. An example of ip-up.local is in /etc/share/doc/ppp-2.4.?/scripts

Or use NetworkManager - it works fine with updating resolv.conf


Note You need to log in before you can comment on or make changes to this bug.