Check duplex and speed settings of all interfaces in one go


One of the first things you do when checking connectivity issues on the Checkpoint (or any networking gear for that matter) is to see speed and duplex parameters of the interfaces. But have you tried to do it on a firewall with 15-20 interfaces ? No fun entering one by one interfaces' names. Here is the one-liner I use to get speed and duplex settings of all interfaces in one go. All VLAN interfaces of course just take this parameter from underlying physical one.
# for ii in $(ifconfig | awk ' /Ethernet/ {print $1}') ;do ethtool $ii; done | egrep  'eth|Speed|Duplex'

    Settings for eth0:
    Speed: 100Mb/s
    Duplex: Full
    Settings for eth1:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth1.150:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth1.160:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth1.161:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth1.270:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth1.271:
    Speed: 1000Mb/s
    Duplex: Full
    <!-- more -->
    Settings for eth1.281:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth1.35:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth2:
    Speed: 100Mb/s
    Duplex: Full
    Settings for eth3:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.112:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.211:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.311:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.71:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.72:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.73:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.413:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.419:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.451:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.407:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth4.408:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth5:
    Speed: 1000Mb/s
    Duplex: Full
    Settings for eth7:
    Speed: 1000Mb/s
    Duplex: Full

The alternative, via ip address command, way is:

# for ii in $(ip address | awk -F: ' /UP/ {print $2}') ;do ethtool $ii; done | egrep 'Settings|Speed|Duplex'

Settings for lo:
Settings for eth1:
        Speed: 1000Mb/s
        Duplex: Full
Settings for eth5:
        Speed: 1000Mb/s
        Duplex: Full