back
Identificazione delle interfacce di rete

(Nei comandi seguenti si omette l'output dell'interfaccia di loopback per comodità di visualizzazione)

old-style:

debian:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 08:00:27:4c:36:07  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2098 (2.0 KiB)  TX bytes:10902 (10.6 KiB)
          Interrupt:11 Base address:0xd020 
...
...

new-style:

debian:~# ip link show
...
...
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 08:00:27:4c:36:07 brd ff:ff:ff:ff:ff:ff

Assegnamo un indirizzo a quell'interfaccia:

debian:~# dhclient eth0
...
...
Listening on LPF/eth0/08:00:27:4c:36:07
Sending on   LPF/eth0/08:00:27:4c:36:07
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 10.0.2.2
bound to 10.0.2.15 -- renewal in 38509 seconds.

e ripetiamo i comandi:

old-style:

debian:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 08:00:27:4c:36:07  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe4c:3607/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2852 (2.7 KiB)  TX bytes:16978 (16.5 KiB)
          Interrupt:11 Base address:0xd020 
...
...

new-style:

debian:~# ip link show
...
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast \
   state UNKNOWN qlen 1000
    link/ether 08:00:27:4c:36:07 brd ff:ff:ff:ff:ff:ff
back