Web lists-archives.com

Re: ifconfig network resolution




On Sat, Jun 10, 2017 at 8:16 PM, Pascal Hambourg <pascal@xxxxxxxxxxxxxxx> wrote:
> Le 10/06/2017 à 12:13, Joel Rees a écrit :
>>
>> On Sat, Jun 10, 2017 at 3:52 PM, Pascal Hambourg <pascal@xxxxxxxxxxxxxxx>
>> 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