No ifconfig [Was: no /etc/inittab]

2017-08-28 Thread Jonathan de Boyne Pollard

Greg Wooledge:



wooledg:~$ ip link
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1
 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000
 link/ether a0:8c:fd:c3:89:e0 brd ff:ff:ff:ff:ff:ff

Parsing the interface names out of THAT is significantly harder.



In support of my earlier point that some /other/ people /did/ make 
modern |ifconfig| usable in such ways:

JdeBP % ifconfig -l
bge0 bge1 lo0 tun0
JdeBP %


Here's something from a script of mine:

list_available_network_interfaces() {
 case "`uname`" in
 Linux)  /bin/ls /sys/class/net ;;
 *)  ifconfig -l ;;
 esac
}


(Note that this is as loose as it is because I'm only targetting 
Linux-based operating systems and the BSDs so far here.  Also note that 
this breaks on OpenBSD which does not have the |-l| option to 
|ifconfig|.  Fixing that is on the to-do list.)




Re: Re: Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread Clive Standbridge

>  Much less was I trying to criticize you,

Oh I didn't think you were :-)


> Just trying to raise awareness about (the few) shell variation idiosyncracies
> I know about, to help making people's lives easier.

Sounds good to me.

-- 
Cheers,
Clive



Re: Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, Aug 16, 2017 at 02:56:01PM +0100, Clive Standbridge wrote:
> 
> > The "declare", OTOH, is pretty Bashist. But it can be replaced by
> > a simple "echo":
> 
> True. It was just a convenient way of showing that the variable hadn't
> absorbed any white space. 

Understood. Please, don't get me wrong -- I'm not an anti-Bashist, by
far (on the contrary, I'm a fan of Bash and some of its features,
actually). Much less was I trying to criticize you, who provided that
nifty script in the first place.

Just trying to raise awareness about (the few) shell variation idiosyncracies
I know about, to help making people's lives easier.

> Besides, I was just picking up the "Bash can't do it" gauntlet. I'd
> often prefer awk in such a situation (like Erik and Greg have
> mentioned).

Uh, oh. Bash can do quite a lot of things :-)

Cheers
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlmUWSMACgkQBcgs9XrR2kbkGgCfZTPk07MqjQza0MCbS4KnWojp
VokAnjyBNWqZ0Jx5DSYwxK69vm5XRfhG
=juko
-END PGP SIGNATURE-



Re: Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread Clive Standbridge

> The "declare", OTOH, is pretty Bashist. But it can be replaced by
> a simple "echo":

True. It was just a convenient way of showing that the variable hadn't
absorbed any white space. 

Besides, I was just picking up the "Bash can't do it" gauntlet. I'd
often prefer awk in such a situation (like Erik and Greg have
mentioned).

-- 
Cheers,
Clive



Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread Greg Wooledge
On Wed, Aug 16, 2017 at 11:58:06AM +0200, to...@tuxteam.de wrote:
>   oldIFS="$IFS"; IFS=': '; ip -o link | while read num interface other;
> do echo "$interface"; done; IFS="$oldIFS" 

ip -o link | while IFS=' :' read -r _ i _; do echo "<$i>"; done

There's no need to set IFS globally and then attempt to restore it,
especially since "restoring" it fails if it was previously unset.
Just set it for the duration of the read command.

The alternative is to make IFS local, within a function:

foo() {
  local IFS=' :'
  ip -o link | while read -r _ i _; do echo "<$i>"; done
}
foo

But once again, this is overkill, when IFS only needs to be modified in
the execution environment of the read command.  (Also less portable,
because POSIX shell functions don't necessarily have "local".)



Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, Aug 16, 2017 at 04:58:24AM -0400, Gene Heskett wrote:
> On Wednesday 16 August 2017 03:28:43 Clive Standbridge wrote:
> 
> > oldIFS="$IFS"; IFS=': '; ip -o link | while read num interface other;
> > do declare -p interface; done; IFS="$oldIFS"
> 
> Now thats an interesting bit of bashism, and deeper into it than I have 
> waded. But for this local network, I know what they are so I can't think 
> of a situation that would make me use it.  But it may well be useful in 
> the future, so the message is marked to protect it from the expiry 
> rules.

Nice idiomatic little script.

Changing the input field separator (IFS) to parse lines is actually a
shell classic and should work on most shells (I just tested with dash),

The "declare", OTOH, is pretty Bashist. But it can be replaced by
a simple "echo":

This should be more portable (at least across the Bourne family):

  oldIFS="$IFS"; IFS=': '; ip -o link | while read num interface other;
do echo "$interface"; done; IFS="$oldIFS" 

Cheers
- -- tomás
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlmUFy4ACgkQBcgs9XrR2kaO0gCePvWrmGWeOv8KNGjLrrI2o2GO
cZ4An1lJ/2IVkGKF4Gc/nfyVa/0vV75M
=nic4
-END PGP SIGNATURE-



Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread Gene Heskett
On Wednesday 16 August 2017 03:28:43 Clive Standbridge wrote:

> oldIFS="$IFS"; IFS=': '; ip -o link | while read num interface other;
> do declare -p interface; done; IFS="$oldIFS"

Now thats an interesting bit of bashism, and deeper into it than I have 
waded. But for this local network, I know what they are so I can't think 
of a situation that would make me use it.  But it may well be useful in 
the future, so the message is marked to protect it from the expiry 
rules.

Thank you Clive.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: Re: No ifconfig [Was: no /etc/inittab]

2017-08-16 Thread Clive Standbridge

> wooledg:~$ ip -o link | awk -F": " '{print $2}'
> lo
> eth0
> 
> The only other scripting language I know that can do splitting with
> multi-character separators is perl.
> 
> wooledg:~$ ip -o link | perl -ne '@x=split(/: /); print $x[1], "\n"'
> lo
> eth0
> 
> Bash and Tcl can't do it, at least not with their native toolsets.

Bash can, e.g.

$ oldIFS="$IFS"; IFS=': '; ip -o link | while read num interface other; do 
declare -p interface; done; IFS="$oldIFS"
declare -- interface="lo"
declare -- interface="eth0"
declare -- interface="br0"
declare -- interface="vethJWC4DL"


-- 
Cheers,
Clive



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread David Wright
On Tue 15 Aug 2017 at 21:49:31 (-0400), Gene Heskett wrote:
> On Tuesday 15 August 2017 15:28:32 David Wright wrote:
> 
> > On Tue 15 Aug 2017 at 14:48:50 (-0400), Gene Heskett wrote:
> > > On Tuesday 15 August 2017 14:00:50 Brian wrote:
> > > > On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:
> > > > > On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> > > > > > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > > > > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a 
> écrit :
> > > > > > > > > If it's no longer part of the base system, then perhaps
> > > > > > > > > the system is too base?
> > > > > > > >
> > > > > > > > Please ellaborate. Why should ifconfig be part of the base
> > > > > > > > system?
> > > > > > > >
> > > > > > > > Regards,
> > > > > > >
> > > > > > > Because ip is a pain in the ass to make it run, and still
> > > > > > > gives grossly incomplete information?
> > > > > > >
> > > > > > > In 2 years, I have yet to get a full network report out of
> > > > > > > ip such as ifconfig gives.
> > > > > >
> > > > > > Does   ip addr ; ip -s link   not work for you?
> > > > > >
> > > > > > Cheers,
> > > > > > David.
> > > > >
> > > > > It could I suppose, but thats also an extra 4" of useless fluff
> > > > > on my high res screen.
> > > >
> > > > You really wanted to say "yes" to your problem of two years
> > > > standing being solved, didn't you? But it goes against the grain.
> > > > :)
> > >
> > > I would not go out on that limb and saw it off behind me, but if it
> > > had more labels on the output, it could be helpfull.  For instance
> > > what does this line in its output for eth0 tell me, and where did it
> > > get those numbers?
> > >
> > >inet6 fe80::21f:c6ff:fe62:fcbb/64 scope link
> > >
> > > Compared to the ifconfig eth0 output, that looks to be derived from
> > > its MAC address, but how is such a determination thats its a
> > > globally unique address determined? Anyone can cause a MAC address
> > > to be spoofed. I am doing it myself so that I can change routers
> > > without loseing my ipv4 address, registered at namecheap.
> >
> > That's the ip6 address I just mentioned, which I use to connect
> > machines and short-circuit the wireless legs. As you have gathered,
> > it's just "there" for you to use, eg
> >
> >  scp -p  @[fe80::21f:c6ff:fe62:fcbb%eth0]:/tmp/
> >
> It worked after suitable customizations, but that does seem to be a 
> needlessly complex bit of cli magic to remember with all the years on my 
> wet ram.

Remember? No, I just edited a line out of one of my bash functions.
For host foo,foo files…   transfers files with scp to the same
point in foo's filesystem tree; given no files, it logs in to foo via
ssh instead;   foo-tmp files…   transfers files to foo's /tmp. All
this by the normal ip4 route.   6foo…   duplicates these functions
but over the ip6 link by replacing the usual hostname as above.

> > would transfer _to_ the machine mentioned above _from_ the
> > connected machine's eth0. Another advantage is that you don't have
> > to disturb your normal network configuration on a different
> > interface (ie wlan0 in my case, but it could be another nic).

Cheers,
David.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 15:46:15 Brian wrote:

> On Tue 15 Aug 2017 at 14:53:39 -0400, Gene Heskett wrote:
> > On Tuesday 15 August 2017 14:19:37 David Wright wrote:
> > > On Tue 15 Aug 2017 at 13:24:56 (-0400), Gene Heskett wrote:
> > > > On Tuesday 15 August 2017 10:48:12 Nicolas George wrote:
> > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > > > Around 30 years of familiarity across many *nix flavours.
> > > > >
> > > > > You said it: the only superiority of ifconfig over iproute2 is
> > > > > tradition and familiarity of long-time users. On the other
> > > > > hand, ifconfig is technically inferior on most if not all
> > > > > points.
> > > > >
> > > > > I hope you realize that traditions and familiarity of old
> > > > > geezers can only go so far to justify the evolution or
> > > > > non-evolution of a system. Otherwise, we still would have ed
> > > > > in the base system.
> > > > >
> > > > > Regards,
> > > >
> > > > Nicolas: The nearest ipv6 address to me is likely 150 miles
> > > > north, in Pittsburgh PA. Its all ipv4 here in WV AFAIK.
> > >
> > > Odd, the nearest to me is underneath the table. I use 6 a lot,
> > > as a cat5 cable is much faster than two legs of weak wireless
> > > to the router and back. And it requires no configuration—it's
> > > just there.
> > >
> > > Cheers,
> > > David.
> >
> > Thats a bridge I'll cross, if it gets here before I miss morning
> > roll call. :)
>
> If you do, you'll be on a charge. :)

Around here, the ovens only get lit for cash.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 15:28:32 David Wright wrote:

> On Tue 15 Aug 2017 at 14:48:50 (-0400), Gene Heskett wrote:
> > On Tuesday 15 August 2017 14:00:50 Brian wrote:
> > > On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:
> > > > On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> > > > > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > > > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a 
écrit :
> > > > > > > > If it's no longer part of the base system, then perhaps
> > > > > > > > the system is too base?
> > > > > > >
> > > > > > > Please ellaborate. Why should ifconfig be part of the base
> > > > > > > system?
> > > > > > >
> > > > > > > Regards,
> > > > > >
> > > > > > Because ip is a pain in the ass to make it run, and still
> > > > > > gives grossly incomplete information?
> > > > > >
> > > > > > In 2 years, I have yet to get a full network report out of
> > > > > > ip such as ifconfig gives.
> > > > >
> > > > > Does   ip addr ; ip -s link   not work for you?
> > > > >
> > > > > Cheers,
> > > > > David.
> > > >
> > > > It could I suppose, but thats also an extra 4" of useless fluff
> > > > on my high res screen.
> > >
> > > You really wanted to say "yes" to your problem of two years
> > > standing being solved, didn't you? But it goes against the grain.
> > > :)
> >
> > I would not go out on that limb and saw it off behind me, but if it
> > had more labels on the output, it could be helpfull.  For instance
> > what does this line in its output for eth0 tell me, and where did it
> > get those numbers?
> >
> >inet6 fe80::21f:c6ff:fe62:fcbb/64 scope link
> >
> > Compared to the ifconfig eth0 output, that looks to be derived from
> > its MAC address, but how is such a determination thats its a
> > globally unique address determined? Anyone can cause a MAC address
> > to be spoofed. I am doing it myself so that I can change routers
> > without loseing my ipv4 address, registered at namecheap.
>
> That's the ip6 address I just mentioned, which I use to connect
> machines and short-circuit the wireless legs. As you have gathered,
> it's just "there" for you to use, eg
>
>  scp -p  @[fe80::21f:c6ff:fe62:fcbb%eth0]:/tmp/
>
It worked after suitable customizations, but that does seem to be a 
needlessly complex bit of cli magic to remember with all the years on my 
wet ram.

> would transfer _to_ the machine mentioned above _from_ the
> connected machine's eth0. Another advantage is that you don't have
> to disturb your normal network configuration on a different
> interface (ie wlan0 in my case, but it could be another nic).
>
> Cheers,
> David.


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 15:23:44 Brian wrote:

> On Tue 15 Aug 2017 at 14:48:50 -0400, Gene Heskett wrote:
> > On Tuesday 15 August 2017 14:00:50 Brian wrote:
> > > On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:
> > > > On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> > > > > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > > > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a 
écrit :
> > > > > > > > If it's no longer part of the base system, then perhaps
> > > > > > > > the system is too base?
> > > > > > >
> > > > > > > Please ellaborate. Why should ifconfig be part of the base
> > > > > > > system?
> > > > > > >
> > > > > > > Regards,
> > > > > >
> > > > > > Because ip is a pain in the ass to make it run, and still
> > > > > > gives grossly incomplete information?
> > > > > >
> > > > > > In 2 years, I have yet to get a full network report out of
> > > > > > ip such as ifconfig gives.
> > > > >
> > > > > Does   ip addr ; ip -s link   not work for you?
> > > > >
> > > > > Cheers,
> > > > > David.
> > > >
> > > > It could I suppose, but thats also an extra 4" of useless fluff
> > > > on my high res screen.
> > >
> > > You really wanted to say "yes" to your problem of two years
> > > standing being solved, didn't you? But it goes against the grain.
> > > :)
> >
> > I would not go out on that limb and saw it off behind me,
>
> Deconstruction: I *can* get a full network report out of ip but am not
> going to admit it. Instead, I'll throw some chaff around as a
> diversion.
>
> > but if it
> > had more labels on the output, it could be helpfull.  For instance
> > what does this line in its output for eth0 tell me, and where did it
> > get those numbers?
> >
> >inet6 fe80::21f:c6ff:fe62:fcbb/64 scope link
>
> The same place ifconfig got them from,
>
> > Compared to the ifconfig eth0 output, that looks to be derived from
> > its MAC address, but how is such a determination thats its a
> > globally unique address determined? Anyone can cause a MAC address
> > to be spoofed. I am doing it myself so that I can change routers
> > without loseing my ipv4 address, registered at namecheap.
>
> Deconstruction: Look out! More chaff.

If you want to see it that way, I can't stop you, but I have a netgear 
router I can use as my gatekeeper since both are running dd-wrt, but the 
netgear is telling the whole world its a Buffalo NetFinity from the MAC 
address its using. So the possibility is there, whether you want to 
admit it or not is entirely up to you.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Brian
On Tue 15 Aug 2017 at 14:53:39 -0400, Gene Heskett wrote:

> On Tuesday 15 August 2017 14:19:37 David Wright wrote:
> 
> > On Tue 15 Aug 2017 at 13:24:56 (-0400), Gene Heskett wrote:
> > > On Tuesday 15 August 2017 10:48:12 Nicolas George wrote:
> > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > > Around 30 years of familiarity across many *nix flavours.
> > > >
> > > > You said it: the only superiority of ifconfig over iproute2 is
> > > > tradition and familiarity of long-time users. On the other hand,
> > > > ifconfig is technically inferior on most if not all points.
> > > >
> > > > I hope you realize that traditions and familiarity of old geezers
> > > > can only go so far to justify the evolution or non-evolution of a
> > > > system. Otherwise, we still would have ed in the base system.
> > > >
> > > > Regards,
> > >
> > > Nicolas: The nearest ipv6 address to me is likely 150 miles north,
> > > in Pittsburgh PA. Its all ipv4 here in WV AFAIK.
> >
> > Odd, the nearest to me is underneath the table. I use 6 a lot,
> > as a cat5 cable is much faster than two legs of weak wireless
> > to the router and back. And it requires no configuration—it's
> > just there.
> >
> > Cheers,
> > David.
> 
> Thats a bridge I'll cross, if it gets here before I miss morning roll 
> call. :)

If you do, you'll be on a charge. :)

-- 
Brian.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread David Wright
On Tue 15 Aug 2017 at 14:48:50 (-0400), Gene Heskett wrote:
> On Tuesday 15 August 2017 14:00:50 Brian wrote:
> 
> > On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:
> > > On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> > > > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > > > > If it's no longer part of the base system, then perhaps the
> > > > > > > system is too base?
> > > > > >
> > > > > > Please ellaborate. Why should ifconfig be part of the base
> > > > > > system?
> > > > > >
> > > > > > Regards,
> > > > >
> > > > > Because ip is a pain in the ass to make it run, and still gives
> > > > > grossly incomplete information?
> > > > >
> > > > > In 2 years, I have yet to get a full network report out of ip
> > > > > such as ifconfig gives.
> > > >
> > > > Does   ip addr ; ip -s link   not work for you?
> > > >
> > > > Cheers,
> > > > David.
> > >
> > > It could I suppose, but thats also an extra 4" of useless fluff on
> > > my high res screen.
> >
> > You really wanted to say "yes" to your problem of two years standing
> > being solved, didn't you? But it goes against the grain. :)
> 
> I would not go out on that limb and saw it off behind me, but if it had 
> more labels on the output, it could be helpfull.  For instance what does 
> this line in its output for eth0 tell me, and where did it get those 
> numbers?
> 
>inet6 fe80::21f:c6ff:fe62:fcbb/64 scope link 
> 
> Compared to the ifconfig eth0 output, that looks to be derived from its 
> MAC address, but how is such a determination thats its a globally unique 
> address determined? Anyone can cause a MAC address to be spoofed. I am 
> doing it myself so that I can change routers without loseing my ipv4 
> address, registered at namecheap.

That's the ip6 address I just mentioned, which I use to connect
machines and short-circuit the wireless legs. As you have gathered,
it's just "there" for you to use, eg

 scp -p  @[fe80::21f:c6ff:fe62:fcbb%eth0]:/tmp/

would transfer _to_ the machine mentioned above _from_ the
connected machine's eth0. Another advantage is that you don't have
to disturb your normal network configuration on a different
interface (ie wlan0 in my case, but it could be another nic).

Cheers,
David.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Brian
On Tue 15 Aug 2017 at 14:48:50 -0400, Gene Heskett wrote:

> On Tuesday 15 August 2017 14:00:50 Brian wrote:
> 
> > On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:
> > > On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> > > > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > > > > If it's no longer part of the base system, then perhaps the
> > > > > > > system is too base?
> > > > > >
> > > > > > Please ellaborate. Why should ifconfig be part of the base
> > > > > > system?
> > > > > >
> > > > > > Regards,
> > > > >
> > > > > Because ip is a pain in the ass to make it run, and still gives
> > > > > grossly incomplete information?
> > > > >
> > > > > In 2 years, I have yet to get a full network report out of ip
> > > > > such as ifconfig gives.
> > > >
> > > > Does   ip addr ; ip -s link   not work for you?
> > > >
> > > > Cheers,
> > > > David.
> > >
> > > It could I suppose, but thats also an extra 4" of useless fluff on
> > > my high res screen.
> >
> > You really wanted to say "yes" to your problem of two years standing
> > being solved, didn't you? But it goes against the grain. :)
> 
> I would not go out on that limb and saw it off behind me,

Deconstruction: I *can* get a full network report out of ip but am not
going to admit it. Instead, I'll throw some chaff around as a diversion.

> but if it had 
> more labels on the output, it could be helpfull.  For instance what does 
> this line in its output for eth0 tell me, and where did it get those 
> numbers?
> 
>inet6 fe80::21f:c6ff:fe62:fcbb/64 scope link

The same place ifconfig got them from,

> Compared to the ifconfig eth0 output, that looks to be derived from its 
> MAC address, but how is such a determination thats its a globally unique 
> address determined? Anyone can cause a MAC address to be spoofed. I am 
> doing it myself so that I can change routers without loseing my ipv4 
> address, registered at namecheap.

Deconstruction: Look out! More chaff.

-- 
Brian.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 14:19:37 David Wright wrote:

> On Tue 15 Aug 2017 at 13:24:56 (-0400), Gene Heskett wrote:
> > On Tuesday 15 August 2017 10:48:12 Nicolas George wrote:
> > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > Around 30 years of familiarity across many *nix flavours.
> > >
> > > You said it: the only superiority of ifconfig over iproute2 is
> > > tradition and familiarity of long-time users. On the other hand,
> > > ifconfig is technically inferior on most if not all points.
> > >
> > > I hope you realize that traditions and familiarity of old geezers
> > > can only go so far to justify the evolution or non-evolution of a
> > > system. Otherwise, we still would have ed in the base system.
> > >
> > > Regards,
> >
> > Nicolas: The nearest ipv6 address to me is likely 150 miles north,
> > in Pittsburgh PA. Its all ipv4 here in WV AFAIK.
>
> Odd, the nearest to me is underneath the table. I use 6 a lot,
> as a cat5 cable is much faster than two legs of weak wireless
> to the router and back. And it requires no configuration—it's
> just there.
>
> Cheers,
> David.

Thats a bridge I'll cross, if it gets here before I miss morning roll 
call. :)

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 14:01:28 Nicolas George wrote:

> L'octidi 28 thermidor, an CCXXV, Gene Heskett a écrit :
> > Nicolas: The nearest ipv6 address to me is likely 150 miles north,
> > in Pittsburgh PA. Its all ipv4 here in WV AFAIK.
>
> You seem to be under the misapprehension that the policy of Debian
> development revolves around your personal perceived needs. It does
> not.
>
> Regards,

Not at all, Nicolas, but I do want to be prepared when it (ipv6) does 
arrive in these here hills.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 14:00:50 Brian wrote:

> On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:
> > On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> > > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > > > If it's no longer part of the base system, then perhaps the
> > > > > > system is too base?
> > > > >
> > > > > Please ellaborate. Why should ifconfig be part of the base
> > > > > system?
> > > > >
> > > > > Regards,
> > > >
> > > > Because ip is a pain in the ass to make it run, and still gives
> > > > grossly incomplete information?
> > > >
> > > > In 2 years, I have yet to get a full network report out of ip
> > > > such as ifconfig gives.
> > >
> > > Does   ip addr ; ip -s link   not work for you?
> > >
> > > Cheers,
> > > David.
> >
> > It could I suppose, but thats also an extra 4" of useless fluff on
> > my high res screen.
>
> You really wanted to say "yes" to your problem of two years standing
> being solved, didn't you? But it goes against the grain. :)

I would not go out on that limb and saw it off behind me, but if it had 
more labels on the output, it could be helpfull.  For instance what does 
this line in its output for eth0 tell me, and where did it get those 
numbers?

   inet6 fe80::21f:c6ff:fe62:fcbb/64 scope link 

Compared to the ifconfig eth0 output, that looks to be derived from its 
MAC address, but how is such a determination thats its a globally unique 
address determined? Anyone can cause a MAC address to be spoofed. I am 
doing it myself so that I can change routers without loseing my ipv4 
address, registered at namecheap.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread David Wright
On Tue 15 Aug 2017 at 13:24:56 (-0400), Gene Heskett wrote:
> On Tuesday 15 August 2017 10:48:12 Nicolas George wrote:
> 
> > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > Around 30 years of familiarity across many *nix flavours.
> >
> > You said it: the only superiority of ifconfig over iproute2 is
> > tradition and familiarity of long-time users. On the other hand,
> > ifconfig is technically inferior on most if not all points.
> >
> > I hope you realize that traditions and familiarity of old geezers can
> > only go so far to justify the evolution or non-evolution of a system.
> > Otherwise, we still would have ed in the base system.
> >
> > Regards,
> 
> Nicolas: The nearest ipv6 address to me is likely 150 miles north, in 
> Pittsburgh PA. Its all ipv4 here in WV AFAIK.

Odd, the nearest to me is underneath the table. I use 6 a lot,
as a cat5 cable is much faster than two legs of weak wireless
to the router and back. And it requires no configuration—it's
just there.

Cheers,
David.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Nicolas George
L'octidi 28 thermidor, an CCXXV, Gene Heskett a écrit :
> Nicolas: The nearest ipv6 address to me is likely 150 miles north, in 
> Pittsburgh PA. Its all ipv4 here in WV AFAIK.

You seem to be under the misapprehension that the policy of Debian
development revolves around your personal perceived needs. It does not.

Regards,

-- 
  Nicolas George



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Brian
On Tue 15 Aug 2017 at 13:46:20 -0400, Gene Heskett wrote:

> On Tuesday 15 August 2017 13:07:38 David Wright wrote:
> 
> > On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > > If it's no longer part of the base system, then perhaps the
> > > > > system is too base?
> > > >
> > > > Please ellaborate. Why should ifconfig be part of the base system?
> > > >
> > > > Regards,
> > >
> > > Because ip is a pain in the ass to make it run, and still gives
> > > grossly incomplete information?
> > >
> > > In 2 years, I have yet to get a full network report out of ip such
> > > as ifconfig gives.
> >
> > Does   ip addr ; ip -s link   not work for you?
> >
> > Cheers,
> > David.
> 
> It could I suppose, but thats also an extra 4" of useless fluff on my 
> high res screen.

You really wanted to say "yes" to your problem of two years standing
being solved, didn't you? But it goes against the grain. :)

-- 
Brian.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 13:07:38 David Wright wrote:

> On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> > On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> > > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > > If it's no longer part of the base system, then perhaps the
> > > > system is too base?
> > >
> > > Please ellaborate. Why should ifconfig be part of the base system?
> > >
> > > Regards,
> >
> > Because ip is a pain in the ass to make it run, and still gives
> > grossly incomplete information?
> >
> > In 2 years, I have yet to get a full network report out of ip such
> > as ifconfig gives.
>
> Does   ip addr ; ip -s link   not work for you?
>
> Cheers,
> David.

It could I suppose, but thats also an extra 4" of useless fluff on my 
high res screen.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 10:48:12 Nicolas George wrote:

> L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > Around 30 years of familiarity across many *nix flavours.
>
> You said it: the only superiority of ifconfig over iproute2 is
> tradition and familiarity of long-time users. On the other hand,
> ifconfig is technically inferior on most if not all points.
>
> I hope you realize that traditions and familiarity of old geezers can
> only go so far to justify the evolution or non-evolution of a system.
> Otherwise, we still would have ed in the base system.
>
> Regards,

Nicolas: The nearest ipv6 address to me is likely 150 miles north, in 
Pittsburgh PA. Its all ipv4 here in WV AFAIK.

However, so far I have not been made aware of a traceroute like utility 
that can tell me where any ipv6 blockage might exist, so I haven't a 
clue how far a dns query might get. I don't have it setup here that I 
know of, and there's little or no documentation on how to do it 
available to us mear mortals.  So here at least, anybody that knows how 
to cope with it when it does become a fact of life, can likely leverage 
some sheckles out of that knowledge. For instance, after perusing the 
manpage for traceroute, my ISP is shentel.net, but

gene@GO704:/etc$ traceroute -6 shentel.net
shentel.net: Name or service not known
Cannot handle "host" cmdline arg `shentel.net' on position 1 (argc 2)

But where does the failure occur? Someplace in the chain To or From their 
dns server(s), which probably encompasses at least a dozen hops to get 
to the server to query them.

And uncommenting the ipv6 related lines in the hosts file makes no 
difference. I didn't think it would because /etc/network/interfaces has 
no ipv6 setup in it.  So for starters, what would I add to the 
interfaces file to enable that since I've no clue what to put in it for 
an ipv6 address.

With reference to my hosts file based home network with about 20 names in 
the /etc/hosts file, please give me/us a cli command that shows how 
ifconfig gets it wrong, and ip gets it right in an ipv4 environment. I 
don't think it prudent to just pick some numbers out of "that" 
place. ;-)

Cheers Nicolas, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread David Wright
On Tue 15 Aug 2017 at 11:23:41 (-0400), Gene Heskett wrote:
> On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:
> 
> > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > If it's no longer part of the base system, then perhaps the system
> > > is too base?
> >
> > Please ellaborate. Why should ifconfig be part of the base system?
> >
> > Regards,
> 
> Because ip is a pain in the ass to make it run, and still gives grossly 
> incomplete information?
> 
> In 2 years, I have yet to get a full network report out of ip such as 
> ifconfig gives.

Does   ip addr ; ip -s link   not work for you?

Cheers,
David.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Glenn English
On Tue, Aug 15, 2017 at 3:23 PM, Gene Heskett  wrote:

> Because ip is a pain in the ass to make it run, and still gives grossly
> incomplete information?
>
> In 2 years, I have yet to get a full network report out of ip such as
> ifconfig gives.

How about fixing ip? Like 'ip --config'? Or just 'ip -h'?

I've written many scripts over the years, using ifconfig and others,
and having everything broken now is a major PITA.

I very much agree that sysV init and those old commands were a mess,
especially with the introduction of ipv6. But I'd have more inclined
to fix what was there than to replace it with commands that return
gibberish and kill so many scripts so many people have written.

One of the benefits, to me anyway, of Debian, Linux, and GNU was that
things were very often designed to output text, for the benefit of
humans. For the benefit of computers, that info could easily be parsed
by other commands.

--
Glenn English



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Gene Heskett
On Tuesday 15 August 2017 07:33:53 Nicolas George wrote:

> L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > If it's no longer part of the base system, then perhaps the system
> > is too base?
>
> Please ellaborate. Why should ifconfig be part of the base system?
>
> Regards,

Because ip is a pain in the ass to make it run, and still gives grossly 
incomplete information?

In 2 years, I have yet to get a full network report out of ip such as 
ifconfig gives.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Nicolas George
L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> Around 30 years of familiarity across many *nix flavours.

You said it: the only superiority of ifconfig over iproute2 is tradition
and familiarity of long-time users. On the other hand, ifconfig is
technically inferior on most if not all points.

I hope you realize that traditions and familiarity of old geezers can
only go so far to justify the evolution or non-evolution of a system.
Otherwise, we still would have ed in the base system.

Regards,

-- 
  Nicolas George



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Dejan Jocic
On 15-08-17, Erik Christiansen wrote:
> On 15.08.17 15:03, Dejan Jocic wrote:
> > And what exactly do you miss in ifconfig and net-tools package, that you
> > can not do with ip, which is part of iproute2 package that comes as part
> > of base system?
> 
> Around 30 years of familiarity across many *nix flavours. If the package
> builders are more familiar with ip, then perhaps tradition goes out the
> window. Not a problem. I have installed net-tools.
> 
> Erik
> 

I can understand that very well, even with much less years of
familiarity. But it moves forward, for good or worse. Not first familiar
tool that will vanish, nor last. May we live to see many more. I know
that I've thought something like "you will pry ifconfig out of my cold
dead heands" first time I've used ip. But, time passed and ip almost
become familiar tool.




Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Greg Wooledge
On Tue, Aug 15, 2017 at 03:14:02PM +0100, Darac Marjal wrote:
> Have you looked at "ip -s link"? It's not quite as easy to parse as "netstat
> -in", but all the information's there.

Actually, "ip -o link" is a step in the right direction:

wooledg:~$ ip -o link
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1\link/loopback 00:00:00:00:00:00 brd 
00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000\link/ether a0:8c:fd:c3:89:e0 brd 
ff:ff:ff:ff:ff:ff

Still requires multiple steps to extract the interface names (unless
you use awk, or some other language with wide field delimiters), and
still not as nice as ps h -o ppid "$pid", but I guess we won't ever get
anything nicer.

wooledg:~$ ip -o link | awk -F": " '{print $2}'
lo
eth0

The only other scripting language I know that can do splitting with
multi-character separators is perl.

wooledg:~$ ip -o link | perl -ne '@x=split(/: /); print $x[1], "\n"'
lo
eth0

Bash and Tcl can't do it, at least not with their native toolsets.
I don't know python or ruby or any others.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Henrique de Moraes Holschuh
On Tue, 15 Aug 2017, Felix Miata wrote:
> >> > Please ellaborate. Why should ifconfig be part of the base system?

Indeed.  It shouldn't, and it doesn't anymore.  Maybe net-tools should
be part of the *standard* system, but it certainly does not belong to
the *base* system anymore.

*base* is "what is required for packages to be installed and
upgraded"...

> >> is not anything which needs to be added - we just need busybodies to
> >> refrain from taking it out.

https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.en.html#iproute2

It is broken in that it just *can't* handle the Linux networking stack
except for the bare minimum functionality on IPv4 (no, it doesn't meet
even the bare minimum for IPv6), and the only reason we had to keep it
around by default (consistent output that some scripts scrapped) was
broken by GNU upstream when it took ifconfig out of the bit-rot pit hell
and started maintaining it again.

So, it [somewhat recently] broke scripts that scrapped its output, and
it will give you incomplete/incorrect information because it can't
handle lots of details of the Linux networking stack...

> Interesting man page difference:
> 
> Stretch:
>Ifconfig  is  used  to  configure  the  kernel-resident network
>interfaces.  It is used at boot time to set  up  interfaces  as
>necessary.   After  that, it is usually only needed when debug-
>ging or when system tuning is needed.
> 
>If no arguments are given, ifconfig displays the status of  the
>currently active interfaces.  If a single interface argument is
>given, it displays the status of the given interface only; if a
>single  -a  argument  is  given,  it displays the status of all
>interfaces, even those that are down.  Otherwise, it configures
>an interface.

Which is outdated...

In Debian, it is *not* used to configure anything at boot time: not with
systemd, and not with sysvinit+initscripts.

And if any Debian package wants/needs it, it has to depend on net-tools.

>WARNING: Ifconfig is obsolete on system with Linux kernel newer
>than  2.0.  On this system you should use ip. See the ip manual
>page for details

We should add that paragraph, yes, and remove the "boot time" stuff :-)

-- 
  Henrique Holschuh



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Darac Marjal

On Tue, Aug 15, 2017 at 09:29:37AM -0400, Greg Wooledge wrote:

On Tue, Aug 15, 2017 at 03:03:35PM +0200, Dejan Jocic wrote:

And what exactly do you miss in ifconfig and net-tools package, that you
can not do with ip, which is part of iproute2 package that comes as part
of base system?


What iproute2 and net-tools are BOTH missing is a sane, script-friendly,
user-controllable output format.


Agreed. systemd's "journalctl" gets it right here - a human readable 
"short" output (admittedly, journalctl then goes overboard with the 
number of options for timestamps, but they ARE a thorny issue), a 
verbose output showing all the information and a json output which is 
MUCH more easily parsed by scripts (none of this "The third field from 
the left, except for the first line, which is a header" malarkey).




What iproute2 is specifically missing (as far as I can determine):
consistent option syntax, and any report analogous to "netstat -in":

wooledg:~$ netstat -in
Kernel Interface table
Iface  MTURX-OK RX-ERR RX-DRP RX-OVRTX-OK TX-ERR TX-DRP TX-OVR Flg
eth0  1500  8254258  0  0 0   7682795  0  0  0 BMRU
lo   65536   579959  0  0 0579959  0  0  0 LRU

In a world where virtually every possible output of every reporting
command is atrociously hard to read, that one is the least bad.  You can
actually get the interface names with only two reasonably simple parsing
operations (strip the first line, then strip everything from the first
whitespace to EOL).

The closest analog I've found in iproute2 is "ip link", which looks like:

wooledg:~$ ip link
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000
   link/ether a0:8c:fd:c3:89:e0 brd ff:ff:ff:ff:ff:ff

Parsing the interface names out of THAT is significantly harder.


Have you looked at "ip -s link"? It's not quite as easy to parse as 
"netstat -in", but all the information's there.




The real tragedy is the missed opportunity.  Linux developers wrote
iproute2 from scratch, but they failed to add any kind of user-specified
output format (cf. ps h -o ppid, find -printf %h, etc.), or to sit down
and THINK about how the user interface should be designed.  Instead of
a clean, friendly, consistent, useful new tool we just got this weird
monstrosity that feels like someone decided to change things just because
they were bored one day, without any rhyme or reason or plan.



util-linux is, arguably, going the right way here. libsmartcols[1] 
allows for some rather flexible output options: trees, tables, UTF8 
handling, terminal-width truncation etc.


[1] 
http://karelzak.blogspot.co.uk/2014/05/libsmartcols-pretty-output-for-everyone.html


--
For more information, please reread.


signature.asc
Description: PGP signature


Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Felix Miata
Dejan Jocic composed on 2017-08-15 15:03 (UTC+0200):

> Erik Christiansen wrote:

>> Nicolas George wrote:

>> > Please ellaborate. Why should ifconfig be part of the base system?

>> With pleasure. It is the most basic and useful *nix networking tool,
>> traditional since well back in the last millennium, spanning hp-ux,
>> sunos, then solaris, and various linux distros, in my experience. Even
>> if used mostly interrogatively these days, it is the quickest way to
>> check how "eth0" is currently encrypted, what the IP address is, etc. It

'ip a' get's me what I'm interested in with less typing than 'ifconfig -a'.

>> is not anything which needs to be added - we just need busybodies to
>> refrain from taking it out.

> And what exactly do you miss in ifconfig and net-tools package, that you
> can not do with ip, which is part of iproute2 package that comes as part
> of base system?

Interesting man page difference:

Stretch:
   Ifconfig  is  used  to  configure  the  kernel-resident network
   interfaces.  It is used at boot time to set  up  interfaces  as
   necessary.   After  that, it is usually only needed when debug-
   ging or when system tuning is needed.

   If no arguments are given, ifconfig displays the status of  the
   currently active interfaces.  If a single interface argument is
   given, it displays the status of the given interface only; if a
   single  -a  argument  is  given,  it displays the status of all
   interfaces, even those that are down.  Otherwise, it configures
   an interface.

openSUSE:
   Ifconfig  is  used  to  configure  the  kernel-resident network
   interfaces.  It is used at boot time to set  up  interfaces  as
   necessary.   After  that, it is usually only needed when debug-
   ging or when system tuning is needed.

   WARNING: Ifconfig is obsolete on system with Linux kernel newer
   than  2.0.  On this system you should use ip. See the ip manual
   page for details

   If no arguments are given, ifconfig displays the status of  the
   currently active interfaces.  If a single interface argument is
   given, it displays the status of the given interface only; if a
   single  -a  argument  is  given,  it displays the status of all
   interfaces, even those that are down.  Otherwise, it configures
   an interface.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Erik Christiansen
On 15.08.17 09:29, Greg Wooledge wrote:
> wooledg:~$ netstat -in
> Kernel Interface table
> Iface  MTURX-OK RX-ERR RX-DRP RX-OVRTX-OK TX-ERR TX-DRP TX-OVR Flg
> eth0  1500  8254258  0  0 0   7682795  0  0  0 
> BMRU
> lo   65536   579959  0  0 0579959  0  0  0 LRU
> 
   was compared with:

> wooledg:~$ ip link
> 1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
> DEFAULT group default qlen 1
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0:  mtu 1500 qdisc pfifo_fast state UP 
> mode DEFAULT group default qlen 1000
> link/ether a0:8c:fd:c3:89:e0 brd ff:ff:ff:ff:ff:ff
> 
> Parsing the interface names out of THAT is significantly harder.

Yes, true, for a human that's indisputable. However, a first
off-the-cuff quickie does the trick machine-wise:

$ gawk '/^[0-9]:/ {print $2}' /tmp/mail 
lo:
eth0:

So the situation is eminently remediable, I figure. Obviously the
first-cut snippet can easily be made more robust, but with known input,
there is no immediate need.

> The real tragedy is the missed opportunity.  Linux developers wrote
> iproute2 from scratch, but they failed to add any kind of user-specified
> output format (cf. ps h -o ppid, find -printf %h, etc.), or to sit down
> and THINK about how the user interface should be designed.  Instead of
> a clean, friendly, consistent, useful new tool we just got this weird
> monstrosity that feels like someone decided to change things just because
> they were bored one day, without any rhyme or reason or plan.

If the output remains unchanged, then a bit of awk¹ can easily extract
items of interest. Scripts break very badly, though, if the output
format is fiddled with after it has been in the wild for any extended
period.

But I'm drawn to the familiar per-interface ordered reporting of:

$ ifconfig -a
eth0  Link encap:Ethernet  HWaddr 00:27:21:a0:4f:1e  
  inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
  inet6 addr: ee81::233:17ff:fea3:2f5e/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:573689 errors:0 dropped:0 overruns:0 frame:0
  TX packets:338733 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:800824302 (763.7 MiB)  TX bytes:27874966 (26.5 MiB)
  Interrupt:23 Base address:0xee00 

loLink encap:Local Loopback  
  inet addr:127.0.0.1  Mask:255.0.0.0
  inet6 addr: ::1/128 Scope:Host
  UP LOOPBACK RUNNING  MTU:16436  Metric:1
  RX packets:12551 errors:0 dropped:0 overruns:0 frame:0
  TX packets:12551 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0 
  RX bytes:3328348 (3.1 MiB)  TX bytes:3328348 (3.1 MiB)

That's highly amenable to both human and machine parsing, I submit.

Erik

¹ Yes, I've heard rumours of other text processing languages arising in
  the latter years of the last millennium, but they're probably a
  passing fad, I figure.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Greg Wooledge
On Tue, Aug 15, 2017 at 03:03:35PM +0200, Dejan Jocic wrote:
> And what exactly do you miss in ifconfig and net-tools package, that you
> can not do with ip, which is part of iproute2 package that comes as part
> of base system?

What iproute2 and net-tools are BOTH missing is a sane, script-friendly,
user-controllable output format.

What iproute2 is specifically missing (as far as I can determine):
consistent option syntax, and any report analogous to "netstat -in":

wooledg:~$ netstat -in
Kernel Interface table
Iface  MTURX-OK RX-ERR RX-DRP RX-OVRTX-OK TX-ERR TX-DRP TX-OVR Flg
eth0  1500  8254258  0  0 0   7682795  0  0  0 BMRU
lo   65536   579959  0  0 0579959  0  0  0 LRU

In a world where virtually every possible output of every reporting
command is atrociously hard to read, that one is the least bad.  You can
actually get the interface names with only two reasonably simple parsing
operations (strip the first line, then strip everything from the first
whitespace to EOL).

The closest analog I've found in iproute2 is "ip link", which looks like:

wooledg:~$ ip link
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0:  mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000
link/ether a0:8c:fd:c3:89:e0 brd ff:ff:ff:ff:ff:ff

Parsing the interface names out of THAT is significantly harder.

The real tragedy is the missed opportunity.  Linux developers wrote
iproute2 from scratch, but they failed to add any kind of user-specified
output format (cf. ps h -o ppid, find -printf %h, etc.), or to sit down
and THINK about how the user interface should be designed.  Instead of
a clean, friendly, consistent, useful new tool we just got this weird
monstrosity that feels like someone decided to change things just because
they were bored one day, without any rhyme or reason or plan.



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Erik Christiansen
On 15.08.17 15:03, Dejan Jocic wrote:
> And what exactly do you miss in ifconfig and net-tools package, that you
> can not do with ip, which is part of iproute2 package that comes as part
> of base system?

Around 30 years of familiarity across many *nix flavours. If the package
builders are more familiar with ip, then perhaps tradition goes out the
window. Not a problem. I have installed net-tools.

Erik



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Dejan Jocic
On 15-08-17, Erik Christiansen wrote:
> On 15.08.17 13:33, Nicolas George wrote:
> > L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > > If it's no longer part of the base system, then perhaps the system is
> > > too base?
> > 
> > Please ellaborate. Why should ifconfig be part of the base system?
> 
> With pleasure. It is the most basic and useful *nix networking tool,
> traditional since well back in the last millennium, spanning hp-ux,
> sunos, then solaris, and various linux distros, in my experience. Even
> if used mostly interrogatively these days, it is the quickest way to
> check how "eth0" is currently encrypted, what the IP address is, etc. It
> is not anything which needs to be added - we just need busybodies to
> refrain from taking it out.
> 
> Granted, there's quite a bit of cruft taking up space, like
> NetworkMunger. I've been forced to wipe that from several Ubuntu
> versions in particular, as networking wouldn't function until I did.
> Everything has always been sweet once that was gone. Debian does seem to
> have it more under control, though, so I'll trade - leave both.
> 
> Erik
> 

And what exactly do you miss in ifconfig and net-tools package, that you
can not do with ip, which is part of iproute2 package that comes as part
of base system?





Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Erik Christiansen
On 15.08.17 13:33, Nicolas George wrote:
> L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> > If it's no longer part of the base system, then perhaps the system is
> > too base?
> 
> Please ellaborate. Why should ifconfig be part of the base system?

With pleasure. It is the most basic and useful *nix networking tool,
traditional since well back in the last millennium, spanning hp-ux,
sunos, then solaris, and various linux distros, in my experience. Even
if used mostly interrogatively these days, it is the quickest way to
check how "eth0" is currently encrypted, what the IP address is, etc. It
is not anything which needs to be added - we just need busybodies to
refrain from taking it out.

Granted, there's quite a bit of cruft taking up space, like
NetworkMunger. I've been forced to wipe that from several Ubuntu
versions in particular, as networking wouldn't function until I did.
Everything has always been sweet once that was gone. Debian does seem to
have it more under control, though, so I'll trade - leave both.

Erik



Re: No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Nicolas George
L'octidi 28 thermidor, an CCXXV, Erik Christiansen a écrit :
> If it's no longer part of the base system, then perhaps the system is
> too base?

Please ellaborate. Why should ifconfig be part of the base system?

Regards,

-- 
  Nicolas George



No ifconfig [Was: no /etc/inittab]

2017-08-15 Thread Erik Christiansen
On 14.08.17 16:23, deloptes wrote:
> Erik Christiansen wrote:
> 
> > Now, if that brings back ifconfig as well, I won't have to rummage about
> > finding which package that might be in.
> > 
> 
> $ dpkg -S /sbin/ifconfig
> net-tools: /sbin/ifconfig
> 
> should be installed manually as it is no longer part of the base system
> 
> ... and I thought I learned about systemd too late ... this made my day

Many thanks, deloptes. You made mine, by returning an old friend.
If it's no longer part of the base system, then perhaps the system is
too base?

Erik