Bug 517470

Summary: wvdial pppd not updating /etc/resolv.conf when invoked on USB modem
Product: [Fedora] Fedora Reporter: Richard Chan <rc556677>
Component: pppAssignee: Jiri Skala <jskala>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: aglotov, jskala, linville
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-26 20:22:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 517294    

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