Tag Archive | Ubuntu

Command to determine speed of Network Interface Card (NIC)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
root@x61:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@compaq ~]# ethtool eth0
Settings for eth0:
 Supported ports: [ TP MII ]
 Supported link modes: 10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Supported pause frame use: No
 Supports auto-negotiation: Yes
 Advertised link modes: 10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Advertised pause frame use: No
 Advertised auto-negotiation: Yes
 Link partner advertised link modes: 10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Link partner advertised pause frame use: Symmetric
 Link partner advertised auto-negotiation: Yes
 Speed: 100Mb/s
 Duplex: Full
 Port: MII
 PHYAD: 32
 Transceiver: internal
 Auto-negotiation: on
 Supports Wake-on: pumbg
 Wake-on: d
 Current message level: 0x00000007 (7)
 drv probe link
 Link detected: yes

Start a service on boot Ubuntu

Here are the commands needed to set a service to start on boot.

Tested on Ubuntu Server 14.04 but should work just fine on older versions as well.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
root@t605:/# update-rc.d ntp enable
update-rc.d: warning:  start runlevel arguments (none) do not match ntp Default-Start values (2 3 4 5)
update-rc.d: warning:  stop runlevel arguments (none) do not match ntp Default-Stop values (1)
 Enabling system startup links for /etc/init.d/ntp ...
 Removing any system startup links for /etc/init.d/ntp ...
   /etc/rc1.d/K77ntp
   /etc/rc2.d/S23ntp
   /etc/rc3.d/S23ntp
   /etc/rc4.d/S23ntp
   /etc/rc5.d/S23ntp
 Adding system startup for /etc/init.d/ntp ...
   /etc/rc1.d/K77ntp -> ../init.d/ntp
   /etc/rc2.d/S23ntp -> ../init.d/ntp
   /etc/rc3.d/S23ntp -> ../init.d/ntp
   /etc/rc4.d/S23ntp -> ../init.d/ntp
   /etc/rc5.d/S23ntp -> ../init.d/ntp
 
 
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
                -n: not really
                -f: force
 
The disable|enable API is not stable and might change in the future.