public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* Re: [gentoo-user] ppp-gentoo woes cont'd [SOLVED-sorta]
@ 2012-03-28 20:05 Maxim Wexler
  2012-03-29  0:35 ` Joshua Murphy
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Wexler @ 2012-03-28 20:05 UTC (permalink / raw
  To: gentoo-user

>>
>>> with ppp connections you are not using a dhcp client, pppd gets the
>>> nameserver ip addressess as part of the connection negotiation (if
>>> peerdns is set) and the aforemetioned script in
>>> /etc/ppp/ip-up.d/40-dns.sh writes those to /etc/resolv.conf

This is at the top of /etc/resolv.conf
# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line

But according to /var/log/messages:

Mar 28 13:24:01 lumby pppd[16825]: primary   DNS address 75.153.176.1
Mar 28 13:24:01 lumby pppd[16825]: secondary DNS address 75.153.176.9

But whatever is in resolv.conf is overwritten with blanks AFTER I
connect. Which creates this odd situation where I can ping numbers,
ie, 8.8.8.8 but not com, net, org etc.

Once I "connect" I have to echo the DNS addresses into resolv.conf
before I can reach anything.

Also, I notice whenever I set up a route to my router those numbers
get wiped. Is that the default behavio(u)r?. NB, I have nothing in the
way of services other than ppp configured at all. Maybe later after I
sort it all out I'll rig up something automatic.

Thanks for everybody's hlp

MW

ps:  according to /etc/ppp/ip-up.d/40-dns.sh:

-------------------------------------------------------------------------------------------------------------------------------

#!/bin/sh

# Handle resolv.conf generation when usepeerdns pppd option is being used.
# Used parameters and environment variables:
# $1 - interface name (e.g. ppp0)
# $USEPEERDNS - set if user specified usepeerdns
# $DNS1 and $DNS2 - DNS servers reported by peer

if [ "$USEPEERDNS" ]; then

	if [ -x /sbin/resolvconf ]; then
		{
			echo "# Generated by ppp for $1"
			[ -n "$DNS1" ] && echo "nameserver $DNS1"
			[ -n "$DNS2" ] && echo "nameserver $DNS2"
		} | /sbin/resolvconf -a "$1"
	else
		# add the server supplied DNS entries to /etc/resolv.conf
		# (taken from debian's 0000usepeerdns)

		# follow any symlink to find the real file
		REALRESOLVCONF=$(readlink -f /etc/resolv.conf)
	
		if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then

			# merge the new nameservers with the other options from the old configuration
			{
				grep --invert-match '^nameserver[[:space:]]' $REALRESOLVCONF
				cat /etc/ppp/resolv.conf
			} > $REALRESOLVCONF.tmp

			# backup the old configuration and install the new one
			cp -dpP $REALRESOLVCONF $REALRESOLVCONF.pppd-backup
			mv $REALRESOLVCONF.tmp $REALRESOLVCONF
	
			# correct permissions
			chmod 0644 /etc/resolv.conf
			chown root:root /etc/resolv.conf
		fi
	fi

fi

--------------------------------------------------------------------------------------------------------------------------------

the software is aware of two resolv.confs, one under /etc/, one under
/etc/ppp. /etc/ppp/resolv.conf is correctly filled in, but the other
is wiped. Can anyone see why?

MW



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-29  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28 20:05 [gentoo-user] ppp-gentoo woes cont'd [SOLVED-sorta] Maxim Wexler
2012-03-29  0:35 ` Joshua Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox