Re: pppd and DNS

2017-11-17 Thread oht
I have also had this problem.
OpenBSD is using a very old version of ppp which don't support peerdns.
I've solved this by updating to version 2.4.7. (not to hard) and updated the
ppp(4) in the kernel accordingly.
I've done that based on obsd ver 5.7 so my patches are maybe a little out of
date. 



--
Sent from: http://openbsd-archive.7691.n7.nabble.com/openbsd-user-misc-f3.html



Re: pppd and DNS

2017-11-16 Thread Stefan Sperling
On Thu, Nov 16, 2017 at 08:36:18PM +, Roderick wrote:
> But still I want to get the DNS from the ppp peer.

Then you need to ask your ISP for static nameserver IPs, or use
a umb(4) device, or implement this missing feature in sppp(8)
such that it decodes the relavant IPCP options passed by the
PPP session peer and makes the information available somehow.
See /usr/src/sys/net/if_spppsubr.c for relevant source code.

With my umsm(4) device, running 'tcpdump -n -i ppp0 -v' while
connecting, I see:

23:15:59.704894 IPCP: Configure-Nak, Unknown IPCP code 0x81
 0308 001c 8106 0a0b 0c0d 8306 0a0b 0c0e
 8206 0a0b 0c0d 8406 0a0b 0c0e

This seems to be one of several DNS related IPCP codes which
our sppp(4) driver ignores. According to Table 7.10 here:
https://technet.microsoft.com/en-us/library/cc957981.aspx
"Primary DNS server address | 129 or 0x81"



Re: pppd and DNS

2017-11-16 Thread Stefan Sperling
On Thu, Nov 16, 2017 at 08:09:27PM +, Roderick wrote:
> 
> 
> On Thu, 16 Nov 2017, Stefan Sperling wrote:
> 
> > For WAN devices supported by umsm(4), the situation is a bit better.
> > The umsm(4) driver shows DNS resolver IPs in ifconfig output so scripts
> > can grab them from there.
> 
> Thanks. How do I get the DNS with ifconfig? This is what I get:

Sorry, I got confused. I meant umb(4) devices, not umsm(4) devices.



Re: pppd and DNS

2017-11-16 Thread Roderick


On Thu, 16 Nov 2017, Stefan Sperling wrote:


You could try running unbound(8) and make resolv.conf point to 127.0.0.1.
That should give you working DNS in any case.


That works and was very simple. In oposition to BIND, it was ready
to be consulted.

But still I want to get the DNS from the ppp peer.

Rodrigo.



Re: pppd and DNS

2017-11-16 Thread Roderick



On Thu, 16 Nov 2017, Stefan Sperling wrote:


For WAN devices supported by umsm(4), the situation is a bit better.
The umsm(4) driver shows DNS resolver IPs in ifconfig output so scripts
can grab them from there.


Thanks. How do I get the DNS with ifconfig? This is what I get:

-
root@nc10% ifconfig ppp0
ppp0: flags=8051 mtu 1500
index 6 priority 0 llprio 3
groups: ppp egress
inet 37.80.16.9 --> 10.0.0.1 netmask 0xff00
-

And even to get a remote address above was some kind of gambling:

---
:10.0.0.1
ipcp-accept-local
ipcp-accept-remote
noipdefault
---

Regards
Rodrigo.



Re: pppd and DNS

2017-11-16 Thread Stefan Sperling
On Thu, Nov 16, 2017 at 01:13:55PM +, Roderick wrote:
> 
> Dear Sirs!
> 
> How it is supposed that I get the DNS servers from a PPP connection?
> 
> Should I guess the servers and put them manually in resolv.conf?
> 
> Something like dhclient ppp0 does not work.
> 
> I think this is an old thema:
> 
> http://openbsd-archive.7691.n7.nabble.com/pppd-usepeerdns-td261633.html
> 
> https://marc.info/?l=openbsd-tech&m=111946828027916&w=2
> 
> Is there a solution that I do not know?
> 
> Otherwise I wonder that others do not miss such a feature:
> UMTS providers do not give much information and one must
> lietraly quess it with help google.
> 
> Rodrigo.

Indeed, it seems pppd doesn't support getting DNS resolvers in client mode.
I've run into the same issue years ago. Nowadays I always use a VPN
across such links and just get DNS from the other end of my tunnel.

You could try running unbound(8) and make resolv.conf point to 127.0.0.1.
That should give you working DNS in any case.

For WAN devices supported by umsm(4), the situation is a bit better.
The umsm(4) driver shows DNS resolver IPs in ifconfig output so scripts
can grab them from there.