9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] [9pi] standardize \ normalize setting dns in
@ 2013-03-28 10:06 c117152
  2013-03-28 12:02 ` Jacob Todd
  2013-03-28 12:41 ` Richard Miller
  0 siblings, 2 replies; 14+ messages in thread
From: c117152 @ 2013-03-28 10:06 UTC (permalink / raw)
  To: 9fans

In 9pi, the cmdline.txt allows defining an env var that is evaluated and used by /bin/termrc.local as line arguments for ip/ipconfig. e.g.

term% dossrv -f/dev/sdM0/dos
term% mount -c /srv/dos /mnt
term% cat /mnt/cmdline.txt
readparts=1 nobootprompt=local user=glenda ipconfig='-g 10.0.0.138 ether /net/ether0 10.0.0.13 255.255.255.0'
term%

This however is only sufficient in establishing an ip. For dns resolution it's necessary to add a dns ip to the ndb. e.g.

term% ehco '    dns=8.8.8.8'>>/net/ndb

What I'd like to ask is for termrc.local to have a dns option so something like dns='8.8.8.8 8.8.4.4' will add the entries properly.

R.K.

p.s. Manually adding "ehco '    dns=8.8.8.8'>>/net/ndb" works but I'd like a more "official" solution...



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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-03-28 10:06 [9fans] [9pi] standardize \ normalize setting dns in c117152
@ 2013-03-28 12:02 ` Jacob Todd
  2013-03-28 12:41 ` Richard Miller
  1 sibling, 0 replies; 14+ messages in thread
From: Jacob Todd @ 2013-03-28 12:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]

Then why don't you add it to termrc.local? That's what it is for.

[-- Attachment #2: Type: text/html, Size: 82 bytes --]

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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-03-28 10:06 [9fans] [9pi] standardize \ normalize setting dns in c117152
  2013-03-28 12:02 ` Jacob Todd
@ 2013-03-28 12:41 ` Richard Miller
  2013-04-03 10:39   ` c117152
                     ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Richard Miller @ 2013-03-28 12:41 UTC (permalink / raw)
  To: 9fans

For a machine not receiving net configuration via DHCP, the normal
place to define dns= would be in /lib/ndb/local - 'man 6 ndb' for
information.




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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-03-28 12:41 ` Richard Miller
@ 2013-04-03 10:39   ` c117152
  2013-04-03 10:39   ` c117152
  2013-04-03 10:39   ` c117152
  2 siblings, 0 replies; 14+ messages in thread
From: c117152 @ 2013-04-03 10:39 UTC (permalink / raw)
  To: 9fans

On Thursday, March 28, 2013 2:41:42 PM UTC+2, Richard Miller wrote:
> For a machine not receiving net configuration via DHCP, the normal
> 
> place to define dns= would be in /lib/ndb/local - 'man 6 ndb' for
> 
> information.

Yes. I've already figured out that much:

term% cat /lib/ndb/local

database=
	file=/lib/ndb/local
	file=/lib/ndb/common

auth=sources.cd.bell-labs.com authdom=outside.plan9.bell-labs.com

ip=127.0.0.1 sys=localhost dom=localhost

ipnet=Home ip=10.0.0.0 ipmask=255.255.255.0
	ipgw=10.0.0.138
	dns=1.2.3.4 # (my isp's dns)
	dns=8.8.8.8 # (googleA)
	dns=8.8.4.4 # (googleB)
	dns=10.0.0.138 # (my router for when the net is down but I still want local quarries getting through and local dom - .Home - requests)
	auth=9pi
	cpu=9pi

ip=10.0.0.13 sys=9pi

The thing is, the way I understand and implement it, you have your basic networking split in at least two places: The /lib/ndb/local file and the ip/ipconfig command arguments (being called from termrc.local...). Now, if there's a DHCP then you can forgo /lib/ndb/local and just specify an empty "ipconfig=". However, on a static ip you're only allowed to do everything except feeding it a dns.

My idea is to have a line or two added to termrc.local that will parse a single dns var from the cmdline.txt file. This way you can get the same convenience you'd get with DHCP in a static setup.

I'm not sure it's a possible needless un +\-foreseen complication, lack of interest, an oversight, a security concern or whatever... But it seems to me that it could simplify things a little.

Just a thought really ;)



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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-03-28 12:41 ` Richard Miller
  2013-04-03 10:39   ` c117152
@ 2013-04-03 10:39   ` c117152
  2013-04-03 10:39   ` c117152
  2 siblings, 0 replies; 14+ messages in thread
From: c117152 @ 2013-04-03 10:39 UTC (permalink / raw)
  To: 9fans

On Thursday, March 28, 2013 2:41:42 PM UTC+2, Richard Miller wrote:
> For a machine not receiving net configuration via DHCP, the normal
> 
> place to define dns= would be in /lib/ndb/local - 'man 6 ndb' for
> 
> information.

Yes. I've already figured out that much:

term% cat /lib/ndb/local

database=
	file=/lib/ndb/local
	file=/lib/ndb/common

auth=sources.cd.bell-labs.com authdom=outside.plan9.bell-labs.com

ip=127.0.0.1 sys=localhost dom=localhost

ipnet=Home ip=10.0.0.0 ipmask=255.255.255.0
	ipgw=10.0.0.138
	dns=1.2.3.4 # (my isp's dns)
	dns=8.8.8.8 # (googleA)
	dns=8.8.4.4 # (googleB)
	dns=10.0.0.138 # (my router for when the net is down but I still want local quarries getting through and local dom - .Home - requests)
	auth=9pi
	cpu=9pi

ip=10.0.0.13 sys=9pi

The thing is, the way I understand and implement it, you have your basic networking split in at least two places: The /lib/ndb/local file and the ip/ipconfig command arguments (being called from termrc.local...). Now, if there's a DHCP then you can forgo /lib/ndb/local and just specify an empty "ipconfig=". However, on a static ip you're only allowed to do everything except feeding it a dns.

My idea is to have a line or two added to termrc.local that will parse a single dns var from the cmdline.txt file. This way you can get the same convenience you'd get with DHCP in a static setup.

I'm not sure it's a possible needless un +\-foreseen complication, lack of interest, an oversight, a security concern or whatever... But it seems to me that it could simplify things a little.

Just a thought really.



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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-03-28 12:41 ` Richard Miller
  2013-04-03 10:39   ` c117152
  2013-04-03 10:39   ` c117152
@ 2013-04-03 10:39   ` c117152
  2013-04-03 10:51     ` Richard Miller
  2013-04-03 10:54     ` Bence Fábián
  2 siblings, 2 replies; 14+ messages in thread
From: c117152 @ 2013-04-03 10:39 UTC (permalink / raw)
  To: 9fans

On Mar 28, 8:41 am, 9f...@hamnavoe.com (Richard Miller) wrote:
> For a machine not receiving net configuration via DHCP, the normal
> place to define dns= would be in /lib/ndb/local - 'man 6 ndb' for
> information.

Yes. I've already figured out that much:

term% cat /lib/ndb/local

database=
	file=/lib/ndb/local
	file=/lib/ndb/common

auth=sources.cd.bell-labs.com authdom=outside.plan9.bell-labs.com

ip=127.0.0.1 sys=localhost dom=localhost

ipnet=Home ip=10.0.0.0 ipmask=255.255.255.0
	ipgw=10.0.0.138
	dns=1.2.3.4 # (my isp's dns)
	dns=8.8.8.8 # (googleA)
	dns=8.8.4.4 # (googleB)
	dns=10.0.0.138 # (my router for when the net is down but I still want
local quarries getting through and local dom - .Home - requests)
	auth=9pi
	cpu=9pi

ip=10.0.0.13 sys=9pi

The thing is, the way I understand and implement it, you have your
basic networking split in at least two places: The /lib/ndb/local file
and the ip/ipconfig command arguments (being called from
termrc.local...). Now, if there's a DHCP then you can forgo /lib/ndb/
local and just specify an empty "ipconfig=". However, on a static ip
you're only allowed to do everything except feeding it a dns.

My idea is to have a line or two added to termrc.local that will parse
a single dns var from the cmdline.txt file. This way you can get the
same convenience you'd get with DHCP in a static setup.

I'm not sure it's a possible needless un +\-foreseen complication,
lack of interest, an oversight, a security concern or whatever... But
it seems to me that it could simplify things a little.

Just a thought really.

p.s. This is my third or fourth attempt at a reply. The first two were
on the new groups interface. This attempt is on the old one. hopefully
those aren't coming out somewhere as double\triple\quadruple posts...



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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-03 10:39   ` c117152
@ 2013-04-03 10:51     ` Richard Miller
  2013-04-04  8:49       ` c117152
  2013-04-03 10:54     ` Bence Fábián
  1 sibling, 1 reply; 14+ messages in thread
From: Richard Miller @ 2013-04-03 10:51 UTC (permalink / raw)
  To: 9fans

> My idea is to have a line or two added to termrc.local that will parse
> a single dns var from the cmdline.txt file.

Go ahead.  It's called termrc.'local' because it's your own local
configuration to play with as you like.  There's no "standard".  The
one on sources is an empty template, and the one on the raspberry pi
image is just an initial suggestion.




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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-03 10:39   ` c117152
  2013-04-03 10:51     ` Richard Miller
@ 2013-04-03 10:54     ` Bence Fábián
  1 sibling, 0 replies; 14+ messages in thread
From: Bence Fábián @ 2013-04-03 10:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 2164 bytes --]

what does ndb/query sys $sysname say?

try to add ether and dom like this:

ip=10.0.0.13 sys=9pi ether=xxxxx... dom=9pi.Home



2013/4/3 <c117152@rmqkr.net>

> On Mar 28, 8:41 am, 9f...@hamnavoe.com (Richard Miller) wrote:
> > For a machine not receiving net configuration via DHCP, the normal
> > place to define dns= would be in /lib/ndb/local - 'man 6 ndb' for
> > information.
>
> Yes. I've already figured out that much:
>
> term% cat /lib/ndb/local
>
> database=
>         file=/lib/ndb/local
>         file=/lib/ndb/common
>
> auth=sources.cd.bell-labs.com authdom=outside.plan9.bell-labs.com
>
> ip=127.0.0.1 sys=localhost dom=localhost
>
> ipnet=Home ip=10.0.0.0 ipmask=255.255.255.0
>         ipgw=10.0.0.138
>         dns=1.2.3.4 # (my isp's dns)
>         dns=8.8.8.8 # (googleA)
>         dns=8.8.4.4 # (googleB)
>         dns=10.0.0.138 # (my router for when the net is down but I still
> want
> local quarries getting through and local dom - .Home - requests)
>         auth=9pi
>         cpu=9pi
>
> ip=10.0.0.13 sys=9pi
>
> The thing is, the way I understand and implement it, you have your
> basic networking split in at least two places: The /lib/ndb/local file
> and the ip/ipconfig command arguments (being called from
> termrc.local...). Now, if there's a DHCP then you can forgo /lib/ndb/
> local and just specify an empty "ipconfig=". However, on a static ip
> you're only allowed to do everything except feeding it a dns.
>
> My idea is to have a line or two added to termrc.local that will parse
> a single dns var from the cmdline.txt file. This way you can get the
> same convenience you'd get with DHCP in a static setup.
>
> I'm not sure it's a possible needless un +\-foreseen complication,
> lack of interest, an oversight, a security concern or whatever... But
> it seems to me that it could simplify things a little.
>
> Just a thought really.
>
> p.s. This is my third or fourth attempt at a reply. The first two were
> on the new groups interface. This attempt is on the old one. hopefully
> those aren't coming out somewhere as double\triple\quadruple posts...
>
>

[-- Attachment #2: Type: text/html, Size: 2977 bytes --]

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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-03 10:51     ` Richard Miller
@ 2013-04-04  8:49       ` c117152
  2013-04-04  9:24         ` Bence Fábián
  2013-04-04 11:15         ` Richard Miller
  0 siblings, 2 replies; 14+ messages in thread
From: c117152 @ 2013-04-04  8:49 UTC (permalink / raw)
  To: 9fans

On Wednesday, April 3, 2013 1:51:25 PM UTC+3, Richard Miller wrote:
> Go ahead.  It's called termrc.'local' because it's your own local
> 
> configuration to play with as you like.  There's no "standard".  The
> 
> one on sources is an empty template, and the one on the raspberry pi
> 
> image is just an initial suggestion.

Oh, I see. I'm just used to trying to separate code from data so much I thought a default that keeps the users from editing scripts is the norm and would get "upstreamed". In practice my concern was that I'll replica\pull over it by mistake... I suppose you can tell I'm a linux user :P

On Wednesday, April 3, 2013 1:54:45 PM UTC+3, Bence Fábián wrote:
> what does ndb/query sys $sysname say?
> 
> try to add ether and dom like this:
> 
> 
> ip=10.0.0.13 sys=9pi ether=xxxxx... dom=9pi.Home
> 

Ops. Good call. It returned the ip as the sysname. :)
All better now. Here's some breadcrumbs for any brave adventurers lucky enough to google this discussion:

term% cat /lib/ndb/local

#
#  files comprising the database, use as many as you like, see ndb(6)
#
database=
	file=/lib/ndb/local
	file=/lib/ndb/common

auth=sources.cs.bell-labs.com authdom=outside.plan9.bell-labs.com

#
#  because the public demands the name localsource
#
ip=127.0.0.1 sys=localhost dom=localhost

ipnet=HOME
	ip=10.0.0.0
	ipmask=255.255.255.0
	ipsubmask=255.255.255.0
	ipgw=10.0.0.138
	auth=9pi
	cpu=9pi
	fs=9pi
	dns=1.2.3.4
	dns=8.8.8.8
	dns=8.8.4.4
	dns=10.0.0.138
	dnsdomain=HOME

ip=10.0.0.13 sys=9pi dom=9pi.HOME proto=il

auth=10.0.0.13 authdom=9pi.HOME

term% ndb/query sys $sysname
ip=10.0.0.13 sys=9pi dom=9pi.HOME proto=il 

Thanks !



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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-04  8:49       ` c117152
@ 2013-04-04  9:24         ` Bence Fábián
  2013-04-04 12:40           ` erik quanstrom
  2013-04-04 11:15         ` Richard Miller
  1 sibling, 1 reply; 14+ messages in thread
From: Bence Fábián @ 2013-04-04  9:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

2013/4/4 <c117152@rmqkr.net>

> term% cat /lib/ndb/local
>
> #
> #  files comprising the database, use as many as you like, see ndb(6)
> #
> database=
>         file=/lib/ndb/local
>         file=/lib/ndb/common
>
> auth=sources.cs.bell-labs.com authdom=outside.plan9.bell-labs.com
>
> #
> #  because the public demands the name localsource
> #
> ip=127.0.0.1 sys=localhost dom=localhost
>
> ipnet=HOME
>         ip=10.0.0.0
>         ipmask=255.255.255.0
>         ipsubmask=255.255.255.0
>         ipgw=10.0.0.138
>         auth=9pi
>         cpu=9pi
>         fs=9pi
>         dns=1.2.3.4
>         dns=8.8.8.8
>         dns=8.8.4.4
>         dns=10.0.0.138
>         dnsdomain=HOME
>
> ip=10.0.0.13 sys=9pi dom=9pi.HOME proto=il
>
> auth=10.0.0.13 authdom=9pi.HOME
>
> term% ndb/query sys $sysname
> ip=10.0.0.13 sys=9pi dom=9pi.HOME proto=il
>
> Thanks !
>
>
Suppose you have

ip=10.0.0.13 sys=9pi1 dom=9pi.HOME proto=il

ip=10.0.0.14 sys=9pi4 dom=9pi.HOME proto=il

which one is this machine?
add the 'ether='

excerpt from my /lib/ndb/local:

ipnet=9front ip=10.0.2.0 ipmask=255.255.255.0
ipgw=10.0.2.2
dns=10.150.128.15

sys=thor ether=525400123456 dom=thor.9front
ip=10.0.2.15


and the output on my qemu terminal looks like this:

term% ndb/query sys $sysname
ip=10.0.2.15 ipmask=/120 ipgw=10.0.2.2 sys=thor dns=10.150.128.15
sys=thor ether=525400123456 dom=thor.9front ip=10.0.2.15
term%

[-- Attachment #2: Type: text/html, Size: 3197 bytes --]

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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-04  8:49       ` c117152
  2013-04-04  9:24         ` Bence Fábián
@ 2013-04-04 11:15         ` Richard Miller
  1 sibling, 0 replies; 14+ messages in thread
From: Richard Miller @ 2013-04-04 11:15 UTC (permalink / raw)
  To: 9fans

> my concern was that I'll replica\pull over it by mistake

pull will not update anything you have locally modified, unless
you explicitly tell it to with a '-s file-or-directory-name' parameter.
You get an error message instead.




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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-04  9:24         ` Bence Fábián
@ 2013-04-04 12:40           ` erik quanstrom
  2013-04-04 13:20             ` Bence Fábián
  0 siblings, 1 reply; 14+ messages in thread
From: erik quanstrom @ 2013-04-04 12:40 UTC (permalink / raw)
  To: 9fans

> ipnet=9front ip=10.0.2.0 ipmask=255.255.255.0
> ipgw=10.0.2.2
> dns=10.150.128.15
>
>

5: r
!/bin/upas/marshal -s 'Re: [9fans] [9pi] standardize \ normalize setting dns in' -R /mail/fs/mbox/1698 9fans@9fans.net
> sys=thor ether=525400123456 dom=thor.9front
> ip=10.0.2.15
>
>
> and the output on my qemu terminal looks like this:
>
> term% ndb/query sys $sysname
> ip=10.0.2.15 ipmask=/120 ipgw=10.0.2.2 sys=thor dns=10.150.128.15
> sys=thor ether=525400123456 dom=thor.9front ip=10.0.2.15
> term%

that doesn't look right.  using the ndb excerpt posed,
i get this

	; ndb/query -f /tmp/test.ndb sys thor
	sys=thor ether=525400123456 dom=thor.9front

were some bits left out of your example?

- erik



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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-04 12:40           ` erik quanstrom
@ 2013-04-04 13:20             ` Bence Fábián
  2013-04-04 14:23               ` erik quanstrom
  0 siblings, 1 reply; 14+ messages in thread
From: Bence Fábián @ 2013-04-04 13:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

I tried with a dummy file and I get the same results as you.
My guess (haven't checked anything) that it gets the other
information from /net/ndb.

However I'm in no way an ndb expert. Maybe someone
knowledgable can weigh in on this.


2013/4/4 erik quanstrom <quanstro@quanstro.net>

> > ipnet=9front ip=10.0.2.0 ipmask=255.255.255.0
> > ipgw=10.0.2.2
> > dns=10.150.128.15
> >
> >
>
> 5: r
> !/bin/upas/marshal -s 'Re: [9fans] [9pi] standardize \ normalize setting
> dns in' -R /mail/fs/mbox/1698 9fans@9fans.net
> > sys=thor ether=525400123456 dom=thor.9front
> > ip=10.0.2.15
> >
> >
> > and the output on my qemu terminal looks like this:
> >
> > term% ndb/query sys $sysname
> > ip=10.0.2.15 ipmask=/120 ipgw=10.0.2.2 sys=thor dns=10.150.128.15
> > sys=thor ether=525400123456 dom=thor.9front ip=10.0.2.15
> > term%
>
> that doesn't look right.  using the ndb excerpt posed,
> i get this
>
>         ; ndb/query -f /tmp/test.ndb sys thor
>         sys=thor ether=525400123456 dom=thor.9front
>
> were some bits left out of your example?
>
> - erik
>
>

[-- Attachment #2: Type: text/html, Size: 1746 bytes --]

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

* Re: [9fans] [9pi] standardize \ normalize setting dns in
  2013-04-04 13:20             ` Bence Fábián
@ 2013-04-04 14:23               ` erik quanstrom
  0 siblings, 0 replies; 14+ messages in thread
From: erik quanstrom @ 2013-04-04 14:23 UTC (permalink / raw)
  To: 9fans

On Thu Apr  4 09:21:30 EDT 2013, begnoc@gmail.com wrote:

> I tried with a dummy file and I get the same results as you.
> My guess (haven't checked anything) that it gets the other
> information from /net/ndb.
>
> However I'm in no way an ndb expert. Maybe someone
> knowledgable can weigh in on this.

it's possible to get some funny results if the file format
isn't just as ndb would like.  ndb has some funny rules.
i wrote a little program ndb/vrfy (ndbvrfy(10);
http://9atom.org/magic/man2html/10/ndbvrfy
to help identify syntax errors in the file that can lead to
bad translations.

- erik



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

end of thread, other threads:[~2013-04-04 14:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-28 10:06 [9fans] [9pi] standardize \ normalize setting dns in c117152
2013-03-28 12:02 ` Jacob Todd
2013-03-28 12:41 ` Richard Miller
2013-04-03 10:39   ` c117152
2013-04-03 10:39   ` c117152
2013-04-03 10:39   ` c117152
2013-04-03 10:51     ` Richard Miller
2013-04-04  8:49       ` c117152
2013-04-04  9:24         ` Bence Fábián
2013-04-04 12:40           ` erik quanstrom
2013-04-04 13:20             ` Bence Fábián
2013-04-04 14:23               ` erik quanstrom
2013-04-04 11:15         ` Richard Miller
2013-04-03 10:54     ` Bence Fábián

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).