ifconfig network resolution (Re: pointers to material for using netbook's wireless as access point)

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

ifconfig network resolution (Re: pointers to material for using netbook's wireless as access point)

Joel Rees-3
Experimenting from the command line, I find myself puzzled about the
arguments for ifconfig.

Reading the manual, it would appear that the arguments for ifconfig
should be something like this:

    ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
broadcast 10.19.23.223 10.19.23.94

But the command returns with

SIOCSIFNETMASK: Can't allocate this address.
SIOCSIFBRDADDR: Can't allocate this address.

If I repeat the command, it gives no errors, but the netmask and
broadcast address end up full class A (255.0.0.0 and 10.255.255.255).

Anyone have an idea what's happening?

--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with a bare cast.

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution (Re: pointers to material for using netbook's wireless as access point)

Joel Rees-3
Sorry my typing is so lame.

On Sat, Jun 10, 2017 at 10:57 AM, Joel Rees <[hidden email]> wrote:
> Experimenting from the command line, I find myself puzzled about the
> arguments for ifconfig.
>
> Reading the manual, it would appear that the arguments for ifconfig
> should be something like this:
>
>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
> broadcast 10.19.23.223 10.19.23.94

   sudo ifconfig eth0 netmask 255.255.255.224 broadcast 10.19.23.223
10.19.23.194

> But the command returns with
>
> SIOCSIFNETMASK: Can't allocate this address.
> SIOCSIFBRDADDR: Can't allocate this address.
>
> If I repeat the command, it gives no errors, but the netmask and
> broadcast address end up full class A (255.0.0.0 and 10.255.255.255).

But if I repeat it often enough (with legitimate parameters), it seems to
decide to believe me, and sets the nic to the requested netmask and
broadcast address.

Once or twice may have been bad parameters, but I have just hit the
up arrow and it goes ahead and sets the parameters to what I said on
the second try.

> Anyone have an idea what's happening?

--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with my bare cast.

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Pascal Hambourg-2
In reply to this post by Joel Rees-3
Le 10/06/2017 à 03:57, Joel Rees a écrit :

> Experimenting from the command line, I find myself puzzled about the
> arguments for ifconfig.
>
> Reading the manual, it would appear that the arguments for ifconfig
> should be something like this:
>
>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
> broadcast 10.19.23.223 10.19.23.94
>
> But the command returns with
>
> SIOCSIFNETMASK: Can't allocate this address.
> SIOCSIFBRDADDR: Can't allocate this address.

You set the mask twice.
The address must be set before the mask and broadcast address.

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
On Sat, Jun 10, 2017 at 3:52 PM, Pascal Hambourg <[hidden email]> wrote:

> Le 10/06/2017 à 03:57, Joel Rees a écrit :
>>
>> Experimenting from the command line, I find myself puzzled about the
>> arguments for ifconfig.
>>
>> Reading the manual, it would appear that the arguments for ifconfig
>> should be something like this:
>>
>>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
>> broadcast 10.19.23.223 10.19.23.94
>>
>> But the command returns with
>>
>> SIOCSIFNETMASK: Can't allocate this address.
>> SIOCSIFBRDADDR: Can't allocate this address.
>
>
> You set the mask twice.

Actually, I did not set the the mask twice, I just typed it it twice. ;/

I hand-typed it from memory, as I noted in my followup.

But I did check, and I get the same kinds of results when I without
typing extra parameters.

> The address must be set before the mask and broadcast address.

Now there's another puzzle, because the man page indicates that the
address should come after the options.

I had been used to typing it before the options, and was getting the
same kind of results with the address before the parameters, I think.

--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with a bare cast.

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Pascal Hambourg-2
Le 10/06/2017 à 12:13, Joel Rees a écrit :

> On Sat, Jun 10, 2017 at 3:52 PM, Pascal Hambourg <[hidden email]> wrote:
>> Le 10/06/2017 à 03:57, Joel Rees a écrit :
>>>
>>>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
>>> broadcast 10.19.23.223 10.19.23.94
>>>
>>> But the command returns with
>>>
>>> SIOCSIFNETMASK: Can't allocate this address.
>>> SIOCSIFBRDADDR: Can't allocate this address.
(...)
>> The address must be set before the mask and broadcast address.
>
> Now there's another puzzle, because the man page indicates that the
> address should come after the options.

Actually the man page does not indicate any order : it just says "option
| address ..." (options or address)

> I had been used to typing it before the options, and was getting the
> same kind of results with the address before the parameters, I think.

I tested before replying and got the correct result.

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
On Sat, Jun 10, 2017 at 8:16 PM, Pascal Hambourg <[hidden email]> wrote:

> Le 10/06/2017 à 12:13, Joel Rees a écrit :
>>
>> On Sat, Jun 10, 2017 at 3:52 PM, Pascal Hambourg <[hidden email]>
>> wrote:
>>>
>>> Le 10/06/2017 à 03:57, Joel Rees a écrit :
>>>>
>>>>
>>>>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
>>>> broadcast 10.19.23.223 10.19.23.94

Noting, as I did in my previous followup post, that the device address
and the broadcast address and the netmask do not match.

>>>> But the command returns with
>>>>
>>>> SIOCSIFNETMASK: Can't allocate this address.
>>>> SIOCSIFBRDADDR: Can't allocate this address.
>
> (...)
>>>
>>> The address must be set before the mask and broadcast address.
>>
>>
>> Now there's another puzzle, because the man page indicates that the
>> address should come after the options.
>
>
> Actually the man page does not indicate any order : it just says "option |
> address ..." (options or address)

I guess it could be read that way.

8)

Would that mean you could give it more than one address to assign to
the device on a single command line?

>> I had been used to typing it before the options, and was getting the
>> same kind of results with the address before the parameters, I think.
>
>
> I tested before replying and got the correct result.
>

Okay, I guess my follow-up wasn't clear enough.

-----------------------------------------
myadm@mycomp:~$ sudo ifconfig eth0:1 down
myadm@mycomp:~$ sudo ifconfig eth0:1
eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
          UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
          割り込み:42 ベースアドレス:0xa000

myadm@mycomp:~$ sudo ifconfig eth0:1 netmask 255.255.255.224 broadcast
10.19.201.223 10.19.201.198
SIOCSIFNETMASK: 要求アドレスに割り当てられません
SIOCSIFBRDADDR: 要求アドレスに割り当てられません
SIOCSIFFLAGS: 要求アドレスに割り当てられません
myadm@mycomp:~$ sudo ifconfig eth0:1
eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
          inetアドレス:10.19.201.198 ブロードキャスト:10.255.255.255  マスク:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
          割り込み:42 ベースアドレス:0xa000

myadm@mycomp:~$ sudo ifconfig eth0:1 netmask 255.255.255.224 broadcast
10.19.201.223 10.19.201.198
myadm@mycomp:~$ sudo ifconfig eth0:1
eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
          inetアドレス:10.19.201.198 ブロードキャスト:10.19.201.223  マスク:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
          割り込み:42 ベースアドレス:0xa000

myadm@mycomp:~$ sudo ifconfig eth0:1 down
myadm@mycomp:~$ sudo ifconfig eth0:1 10.19.201.198 netmask
255.255.255.224 broadcast 10.19.201.223
myadm@mycomp:~$ sudo ifconfig eth0:1
eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
          inetアドレス:10.19.201.198 ブロードキャスト:10.19.201.223  マスク:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
          割り込み:42 ベースアドレス:0xa000

myadm@mycomp:~$ sudo ifconfig eth0:1 down
-----------------------------------------

I still say the man page could use a little revision.

--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with a bare cast.

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joe Rowan
On Sat, 10 Jun 2017 23:36:06 +0900
Joel Rees <[hidden email]> wrote:


> -----------------------------------------
> myadm@mycomp:~$ sudo ifconfig eth0:1 down
> myadm@mycomp:~$ sudo ifconfig eth0:1
> eth0:1    Link encap:イーサネット  ハードウェアアドレス
> 50:af:73:12:64:aa UP BROADCAST RUNNING MULTICAST  MTU:1500
> メトリック:1 割り込み:42 ベースアドレス:0xa000
>

Your problem is getting worse. Your computer appears to be learning
Japanese.

--
Joe

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Cindy Sue Causey
On 6/10/17, Joe <[hidden email]> wrote:

> On Sat, 10 Jun 2017 23:36:06 +0900
> Joel Rees <[hidden email]> wrote:
>
>
>> -----------------------------------------
>> myadm@mycomp:~$ sudo ifconfig eth0:1 down
>> myadm@mycomp:~$ sudo ifconfig eth0:1
>> eth0:1    Link encap:イーサネット  ハードウェアアドレス
>> 50:af:73:12:64:aa UP BROADCAST RUNNING MULTICAST  MTU:1500
>> メトリック:1 割り込み:42 ベースアドレス:0xa000
>>
>
> Your problem is getting worse. Your computer appears to be learning
> Japanese.


That was so funny, I just took a swig of coffee so I could spew it
when I laughed yet again...

The good news is... OUR computers are set up universally enough that
we can see those very pretty Japanese characters on this end.......

PS Thanks, I really needed that laugh........ :)

--
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with duct tape *

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Cindy Sue Causey
On 6/10/17, Cindy-Sue Causey <[hidden email]> wrote:

> On 6/10/17, Joe <[hidden email]> wrote:
>> On Sat, 10 Jun 2017 23:36:06 +0900
>> Joel Rees <[hidden email]> wrote:
>>
>>
>>> -----------------------------------------
>>> myadm@mycomp:~$ sudo ifconfig eth0:1 down
>>> myadm@mycomp:~$ sudo ifconfig eth0:1
>>> eth0:1    Link encap:イーサネット  ハードウェアアドレス
>>> 50:af:73:12:64:aa UP BROADCAST RUNNING MULTICAST  MTU:1500
>>> メトリック:1 割り込み:42 ベースアドレス:0xa000
>>>
>>
>> Your problem is getting worse. Your computer appears to be learning
>> Japanese.
>
>
> That was so funny, I just took a swig of coffee so I could spew it
> when I laughed yet again...
>
> The good news is... OUR computers are set up universally enough that
> we can see those very pretty Japanese characters on this end.......
>
> PS Thanks, I really needed that laugh........ :)


PPS I'm thinking... ABORT MISSION POSTHASTE.....

Anyone have tips for him right now.... *while he can read them*
related to the language appearing to switch teams on him? It's been
long enough in between debootstrap installs that I'm too rusty on
where to touch on that to see how things are going.

My apologies in advance because I'm asking that without knowing if he
does or does not actually speak Japanese. He might be able to read
that quite well. In that case, I'm envious because that's on a #Life
to-do bucket list for me.. :)

Cindy :)

--
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with duct tape *

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
In reply to this post by Joel Rees-3
Sorry, again,

On Sat, Jun 10, 2017 at 11:36 PM, Joel Rees <[hidden email]> wrote:

> On Sat, Jun 10, 2017 at 8:16 PM, Pascal Hambourg <[hidden email]> wrote:
>> Le 10/06/2017 à 12:13, Joel Rees a écrit :
>>>
>>> On Sat, Jun 10, 2017 at 3:52 PM, Pascal Hambourg <[hidden email]>
>>> wrote:
>>>>
>>>> Le 10/06/2017 à 03:57, Joel Rees a écrit :
>>>>>
>>>>>
>>>>>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
>>>>> broadcast 10.19.23.223 10.19.23.94
>
> Noting, as I did in my previous followup post, that the device address
> and the broadcast address and the netmask do not match.
>
>>>>> But the command returns with
>>>>>
>>>>> SIOCSIFNETMASK: Can't allocate this address.
>>>>> SIOCSIFBRDADDR: Can't allocate this address.
>>
>> (...)
>>>>
>>>> The address must be set before the mask and broadcast address.
>>>
>>>
>>> Now there's another puzzle, because the man page indicates that the
>>> address should come after the options.
>>
>>
>> Actually the man page does not indicate any order : it just says "option |
>> address ..." (options or address)
>
> I guess it could be read that way.
>
> 8)
>
> Would that mean you could give it more than one address to assign to
> the device on a single command line?
>
>>> I had been used to typing it before the options, and was getting the
>>> same kind of results with the address before the parameters, I think.
>>
>>
>> I tested before replying and got the correct result.
>>
>
> Okay, I guess my follow-up wasn't clear enough.
>
> -----------------------------------------
> myadm@mycomp:~$ sudo ifconfig eth0:1 down
> myadm@mycomp:~$ sudo ifconfig eth0:1
> eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
ethernet hardware address
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
>           割り込み:42 ベースアドレス:0xa000
metric:1 IRQ:42 base address: 0xa000
>
> myadm@mycomp:~$ sudo ifconfig eth0:1 netmask 255.255.255.224 broadcast
> 10.19.201.223 10.19.201.198
> SIOCSIFNETMASK: 要求アドレスに割り当てられません
Could not allocate requested address
> SIOCSIFBRDADDR: 要求アドレスに割り当てられません
could not allocate requested address
> SIOCSIFFLAGS: 要求アドレスに割り当てられません
could not allocate requested address
> myadm@mycomp:~$ sudo ifconfig eth0:1
> eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
>           inetアドレス:10.19.201.198 ブロードキャスト:10.255.255.255  マスク:255.0.0.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
>           割り込み:42 ベースアドレス:0xa000
>
(see above)

> myadm@mycomp:~$ sudo ifconfig eth0:1 netmask 255.255.255.224 broadcast
> 10.19.201.223 10.19.201.198
> myadm@mycomp:~$ sudo ifconfig eth0:1
> eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
>           inetアドレス:10.19.201.198 ブロードキャスト:10.19.201.223  マスク:255.255.255.224
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
>           割り込み:42 ベースアドレス:0xa000
>
> myadm@mycomp:~$ sudo ifconfig eth0:1 down
> myadm@mycomp:~$ sudo ifconfig eth0:1 10.19.201.198 netmask
> 255.255.255.224 broadcast 10.19.201.223
> myadm@mycomp:~$ sudo ifconfig eth0:1
> eth0:1    Link encap:イーサネット  ハードウェアアドレス 50:af:73:12:64:aa
>           inetアドレス:10.19.201.198 ブロードキャスト:10.19.201.223  マスク:255.255.255.224
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  メトリック:1
>           割り込み:42 ベースアドレス:0xa000
>
> myadm@mycomp:~$ sudo ifconfig eth0:1 down
> -----------------------------------------
>
> I still say the man page could use a little revision.
>
> --
> Joel Rees
>
> One of these days I'll get someone to pay me
> to design a language that combines the best of Forth and C.
> Then I'll be able to leap wide instruction sets with a single #ifdef,
> run faster than a speeding infinite loop with a #define,
> and stop all integer size bugs with a bare cast.
>
> More of my delusions:
> http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
> http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
Okay, here it is in the common language:

---------------------------------
myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1 down
myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
eth0:1    Link encap:Ethernet  HWaddr 53:bc:81:02:21:bb
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:42 Base address:0xa000

# with everything cleared:

myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1 netmask
255.255.255.224 broadcast 10.19.201.223 10.19.201.198
SIOCSIFNETMASK: Cannot assign requested address
SIOCSIFBRDADDR: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address

# check it,

myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
eth0:1    Link encap:Ethernet  HWaddr 53:bc:81:02:21:bb
          inet addr:10.19.201.198  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:42 Base address:0xa000


# and apparently it is
# processing the arguments in the order they are given,
# and applying them to the state at the point they are given,
# which I sort of thought might be the case, but doesn't seem to be
# be clearly stated in the man pages.

# Thus, if you repeat the command as given,

myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1 netmask
255.255.255.224 broadcast 10.19.201.223 10.19.201.198

# and check again,

myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
eth0:1    Link encap:Ethernet  HWaddr 53:bc:81:02:21:bb
          inet addr:10.19.201.198  Bcast:10.19.201.223  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:42 Base address:0xa000

# this time it sets them as intended.

# If the address to be assigned is given first, which I think everyone
# pretty much does:

myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1 down
myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
10.19.201.198 netmask 255.255.255.224 broadcast 10.19.201.223
myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
eth0:1    Link encap:Ethernet  HWaddr 53:bc:81:02:21:bb
          inet addr:10.19.201.198  Bcast:10.19.201.223  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:42 Base address:0xa000

# it seems to see the address first and set things as intended in one pass.
---------------------------------

Which is confusing to my middle-aged brain. So I could suggest editing
the man page, something along the lines of the following

---------------------------------
SYNOPSIS
       ifconfig [-v] [-a] [-s] [interface]
{change}
       ifconfig [-v] interface [aftype] options | address ...
{change-to}
       ifconfig [-v] interface [aftype] [ display-options ] [ address
] [ other-options ... ]
{end change}


DESCRIPTION
       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 debugging 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.

{move the interface paragraph here:}
interface
      The name of the interface.  This is usually a driver name followed by
      a unit  number, for  example  eth0  for the first Ethernet interface.
      If your kernel supports alias interfaces, you can specify them with
      eth0:0 for the first alias of eth0. You can use them to assign a second
      address. To delete an alias interface use ifconfig eth0:0 down.
      Note: for every scope (i.e. same net  with  address/netmask  combina-
      tion) all aliases are deleted, if you delete the first (primary).
{end move}

Address Families {insert}(aftype){end-insert}
       If the first argument after the interface name is recognized as the
       name  of  a  supported address  family,  that  address  family  is
       used for decoding and displaying all protocol addresses.  Currently
       supported address families include  inet  (TCP/IP,  default),
       inet6 (IPv6), ax25 (AMPR  Packet  Radio), ddp (Appletalk Phase 2),
       ipx (Novell IPX) and netrom (AMPR Packet radio).

{insert}DISPLAY{end-insert} OPTIONS
       -a     display all interfaces which are currently available,
              even if down

       -s     display a short list (like netstat -i)

       -v     be more verbose for some error conditions

{move the address paragraph here:}
address
      The IP address to be assigned to this interface.
{end move}

{insert}OTHER OPTIONS{end-insert}

       up     This  flag  causes the interface to be activated.  It is
              implicitly specified if an address is assigned to the
              interface.

       down   This flag causes the driver for this interface to be shut
              down.

       {...}

       netmask addr
              Set the IP network mask for this interface.  This value
              defaults to the usual class A, B or C network mask (as
              derived from the interface IP address), but  it  can  be
              set to any value.

       {...}

       [-]broadcast [addr]
              If the address argument is given, set  the  protocol
              broadcast  address  for  this interface.  Otherwise,
              set (or clear) the IFF_BROADCAST flag for the interface.

       {...}

NOTES
       The parameters and options are processed in the order given, thus
       if the address appears after the netmask and broadcast address,
       the netmask and broadcast address may be re-interpreted and applied
       to an existing address, or to the state of having no address
       assigned, with unintended results which affect the security state
       of the host.

       {...}
---------------------------------

--
Joel Rees

randomly ranting:
http://reiisi.blogspot.com

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
erk

On Sun, Jun 11, 2017 at 7:55 AM, Joel Rees <[hidden email]> wrote:
> [...]
> Which is confusing to my middle-aged brain. So I could suggest editing
> the man page, something along the lines of the following
>
> ---------------------------------
> [...]
>

{add}

> NOTES
>        The parameters and options are processed in the order given, thus
>        if the address appears after the netmask and broadcast address,
>        the netmask and broadcast address may be re-interpreted and applied
>        to an existing address, or to the state of having no address
>        assigned, with unintended results which affect the security state
>        of the host.

{end add}

>        {...}
> ---------------------------------
>
> --
> Joel Rees
>
> randomly ranting:
> http://reiisi.blogspot.com



--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with a bare cast.

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

andy smith-10
In reply to this post by Joel Rees-3
Hi Joel,

On Sun, Jun 11, 2017 at 07:55:50AM +0900, Joel Rees wrote:

> # If the address to be assigned is given first, which I think everyone
> # pretty much does:
>
> myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1 down
> myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
> 10.19.201.198 netmask 255.255.255.224 broadcast 10.19.201.223
> myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
> eth0:1    Link encap:Ethernet  HWaddr 53:bc:81:02:21:bb
>           inet addr:10.19.201.198  Bcast:10.19.201.223  Mask:255.255.255.224
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           Interrupt:42 Base address:0xa000
>
> # it seems to see the address first and set things as intended in one pass.
> ---------------------------------
>
> Which is confusing to my middle-aged brain.

Have you considered just using "ip"?

# ip address add 10.19.201.198/27 dev eth0

You don't need to specify the broadcast address as it will by
default be the top-most address (10.19.201.233 for
10.19.201.192/27).

> So I could suggest editing the man page, something along the lines
> of the following…

The binaries provided by the net-tools package are considered
obsolete on Linux, and from stretch onwards the package is not
marked essential. It would only be installed if a dependency pulled
it in (which is admittedly still very likely at this point).

I'm not trying to start an ip vs. ifconfig debate, but it is a fact
that development of net-tools has stagnated and already doesn't
support some kernel features.

It seems likely that eventually net-tools will not be in a default
Debian install and you would have to go out of your way to install
it.

So, I am not sure that anyone would be willing to keep the relevant
net-tools manpages up to date.

Even the net-tools maintainers in Debian have wanted it removed from
the base install for more than 8 years now. I'm not saying they
would refuse to fix documentation bugs, but the motivation may be
very low at this point.

Some more info:

    https://lwn.net/Articles/710533/

Cheers,
Andy

--
https://bitfolk.com/ -- No-nonsense VPS hosting

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Lisi Reisz
In reply to this post by Cindy Sue Causey
On Saturday 10 June 2017 21:18:42 Cindy-Sue Causey wrote:
> My apologies in advance because I'm asking that without knowing if he
> does or does not actually speak Japanese. He might be able to read
> that quite well. In that case, I'm envious because that's on a #Life
> to-do bucket list for me.. :)

He lives in Japan and probably actually has a Japanese computer that has to  
be persuaded to talk English. ;-).

Now, I have debugged network problems on a UNIX computer that spoke Japanese,
knowing none myself and reading even less.  AND I succeeded.  I felt very
proud not just of myself but of UNIX.  (Japanese Macbook withMac-OSX)

Lisi

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
In reply to this post by andy smith-10
On Sun, Jun 11, 2017 at 11:09 AM, Andy Smith <[hidden email]> wrote:

> Hi Joel,
>
> On Sun, Jun 11, 2017 at 07:55:50AM +0900, Joel Rees wrote:
>> # If the address to be assigned is given first, which I think everyone
>> # pretty much does:
>>
>> myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1 down
>> myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
>> 10.19.201.198 netmask 255.255.255.224 broadcast 10.19.201.223
>> myadm@mycomp:~$ env LANG=en_US.UTF-8 sudo ifconfig eth0:1
>> eth0:1    Link encap:Ethernet  HWaddr 53:bc:81:02:21:bb
>>           inet addr:10.19.201.198  Bcast:10.19.201.223  Mask:255.255.255.224
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           Interrupt:42 Base address:0xa000
>>
>> # it seems to see the address first and set things as intended in one pass.
>> ---------------------------------
>>
>> Which is confusing to my middle-aged brain.
>
> Have you considered just using "ip"?

Once upon a time, I tried to learn ip.
It does not stick in my memory.
The fires burning from systemd
Still feel fresh and hot to me.
Too hot to think of words more pithy.
But when I left RH behind I felt free.

For a year or two.

When the inevitable happens, I'll probably just kill myself trying to
rewrite the whole thing from scratch, with a unified,logical basis,
and short, concise commands that don't try to take over the whole
system and the kitchen sink.

Just leave me alone in my codgerism.

--
Joel Rees

Trying to re-invent the industry all by myself:
http://defining-computers.blogspot.jp/

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Joel Rees-3
In reply to this post by Lisi Reisz
On Sun, Jun 11, 2017 at 2:04 PM, Lisi Reisz <[hidden email]> wrote:
> On Saturday 10 June 2017 21:18:42 Cindy-Sue Causey wrote:
>> My apologies in advance because I'm asking that without knowing if he
>> does or does not actually speak Japanese. He might be able to read
>> that quite well. In that case, I'm envious because that's on a #Life
>> to-do bucket list for me.. :)
>
> He lives in Japan and probably actually has a Japanese computer that has to
> be persuaded to talk English. ;-).

Sometimes *I* have to be persuaded to speak English.

> Now, I have debugged network problems on a UNIX computer that spoke Japanese,
> knowing none myself and reading even less.  AND I succeeded.  I felt very
> proud not just of myself but of UNIX.  (Japanese Macbook withMac-OSX)
>
> Lisi
>

I like Macs, too.

--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with a bare cast.

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution (Re: pointers to material for using netbook's wireless as access point)

Joe Rowan
In reply to this post by Joel Rees-3
On Sat, 10 Jun 2017 10:57:47 +0900
Joel Rees <[hidden email]> wrote:

> Experimenting from the command line, I find myself puzzled about the
> arguments for ifconfig.
>
> Reading the manual, it would appear that the arguments for ifconfig
> should be something like this:
>
>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
> broadcast 10.19.23.223 10.19.23.94
>
> But the command returns with
>
> SIOCSIFNETMASK: Can't allocate this address.
> SIOCSIFBRDADDR: Can't allocate this address.
>
> If I repeat the command, it gives no errors, but the netmask and
> broadcast address end up full class A (255.0.0.0 and 10.255.255.255).
>
> Anyone have an idea what's happening?
>

Could you humour me for a moment, and try the exercise with one of the
192.168... networks, with the same sized subnet?

I've seen this kind of behaviour a very long time ago, and I can't
really believe it is still happening, but...

--
Joe

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution (Re: pointers to material for using netbook's wireless as access point)

Joel Rees-3
On Sun, Jun 11, 2017 at 4:57 PM, Joe <[hidden email]> wrote:

> On Sat, 10 Jun 2017 10:57:47 +0900
> Joel Rees <[hidden email]> wrote:
>
>> Experimenting from the command line, I find myself puzzled about the
>> arguments for ifconfig.
>>
>> Reading the manual, it would appear that the arguments for ifconfig
>> should be something like this:
>>
>>     ifconfig eth0 netmask 255.255.255.224 netmask 255.255.255.224
>> broadcast 10.19.23.223 10.19.23.94
>>
>> But the command returns with
>>
>> SIOCSIFNETMASK: Can't allocate this address.
>> SIOCSIFBRDADDR: Can't allocate this address.
>>
>> If I repeat the command, it gives no errors, but the netmask and
>> broadcast address end up full class A (255.0.0.0 and 10.255.255.255).
>>
>> Anyone have an idea what's happening?
>>
>
> Could you humour me for a moment, and try the exercise with one of the
> 192.168... networks, with the same sized subnet?
>
> I've seen this kind of behaviour a very long time ago, and I can't
> really believe it is still happening, but...

See the other sub-thread. But it does go to class C instead of the partial
class C when the device address comes at the end of the list.

--
Joel Rees

Trying to re-invent the entire industry all by myself:
http://defining-computers.blogspot.jp/

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution (Re: pointers to material for using netbook's wireless as access point)

Joe Rowan
On Sun, 11 Jun 2017 17:03:40 +0900
Joel Rees <[hidden email]> wrote:

> On Sun, Jun 11, 2017 at 4:57 PM, Joe <[hidden email]> wrote:

> >
> > I've seen this kind of behaviour a very long time ago, and I can't
> > really believe it is still happening, but...  
>
> See the other sub-thread. But it does go to class C instead of the
> partial class C when the device address comes at the end of the list.
>

OK, not what I saw then. I was bitten by a bit of system software
somewhere that treated the 10. network as class A regardless of
netmask. I never got to the bottom of it, but I never again used 10. as
anything other than class A. It was quite a few years ago.

--
Joe

Reply | Threaded
Open this post in threaded view
|

Re: ifconfig network resolution

Richard Owlett-3
In reply to this post by andy smith-10
On 06/10/2017 09:09 PM, Andy Smith wrote:

> [snip]
> Even the net-tools maintainers in Debian have wanted it removed from
> the base install for more than 8 years now. I'm not saying they
> would refuse to fix documentation bugs, but the motivation may be
> very low at this point.
>
> Some more info:
>
>     https://lwn.net/Articles/710533/
>

Though as a computer _user_ I predate Dartmouth BASIC, I'm fairly new to
Linux and as a "de facto" sysadmin for my own computers I'm as raw as
they come.

Can you recommend a good introduction to iproute2 which ignores the
existence of net-tools (start newbies with good habits)?
I find man pages a poor fit for what I'm looking for.
TIA




12