- Products
- Learn
- Local User Groups
- Partners
- More
Firewall Uptime, Reimagined
How AIOps Simplifies Operations and Prevents Outages
Introduction to Lakera:
Securing the AI Frontier!
Check Point Named Leader
2025 Gartner® Magic Quadrant™ for Hybrid Mesh Firewall
HTTPS Inspection
Help us to understand your needs better
CheckMates Go:
SharePoint CVEs and More!
Hello CheckMates,
I'm looking for a One-liner that provides a nice summary about the duplex settings and interface driver (vendor) of every network port in a system. I offer a Thank You badge worth 500 points in rewards.
cpstat os -f ifconfig already provides a nice summary of interface statistics, though missing duplex settings and interface drivers to identify if it's an Intel or a Broadcom or other interface type.
Yuri Slobodyanyuk was creating something that goes into the right direction, but his one-liner is based on ifconfig, so it doesn't show any disabled interfaces. /etc/sysconfig/hwconf or the cpstat command shown above might be a better start to get all the interfaces within a system.
I'm looking forward to your entries. The one-liner that provides the best result wins.
In the interest of advancing the conversation, I will build on this a little. It's not perfect, but it gets closer to what i think you want:
[Expert@gateway:0]# ls -1 /sys/class/net | grep -v ^lo | xargs -I % sh -c 'ethtool %; ethtool -i %' | grep '^driver\|Speed\|Duplex\|Settings' | sed "s/^/ /g" | tr -d "\t" | tr -d "\n" | sed "s/Settings for/\nSettings for/g"
Settings for eth0: Speed: 1000Mb/s Duplex: Full driver: e1000
Settings for eth1: Speed: 1000Mb/s Duplex: Full driver: e1000
Settings for eth2: Speed: 1000Mb/s Duplex: Full driver: e1000[Expert@gateway:0]#
No badges required for me
From expert mode:
dmesg | grep ": eth" | grep -v TSO | sort | uniq
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth0: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth1: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
or
grep ": eth" /var/log/messages* | grep -v TSO | cut -c66-999 | sort | uniq
eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
eth0: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
eth1: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
--
My book "Max Power: Check Point Firewall Performance Optimization"
now available via http://maxpowerfirewalls.com.
I've tested both One-liners on various Check Point Appliances and Open Servers without success. They don't reflect interfaces that start with names other than "eth" (e.g. Mgmt, Sync, Lan1, Lan2, ..) that somes Appliances use. But in general they don't work in most cases. Neither does dmesg contain any ": eth" entries nor does /var/log/messages always show the interface names before the Duplex setting or simply produces a big information overhead and no formatted summary. I'd still suggest that /etc/sysconfig/hwconf or the cpstat command are the best options to start from.
ls -1 /sys/class/net | grep -v ^lo | xargs -I % sh -c 'ethtool %; ethtool -i %' | grep '^driver\|Speed\|Duplex\|Settings' | tr -d "\t"
Settings for eth0:
Speed: 1000Mb/s
Duplex: Full
driver: e1000
Settings for eth1:
Speed: 1000Mb/s
Duplex: Full
driver: e1000
--
My book "Max Power: Check Point Firewall Performance Optimization"
now available via http://maxpowerfirewalls.com.
In the interest of advancing the conversation, I will build on this a little. It's not perfect, but it gets closer to what i think you want:
[Expert@gateway:0]# ls -1 /sys/class/net | grep -v ^lo | xargs -I % sh -c 'ethtool %; ethtool -i %' | grep '^driver\|Speed\|Duplex\|Settings' | sed "s/^/ /g" | tr -d "\t" | tr -d "\n" | sed "s/Settings for/\nSettings for/g"
Settings for eth0: Speed: 1000Mb/s Duplex: Full driver: e1000
Settings for eth1: Speed: 1000Mb/s Duplex: Full driver: e1000
Settings for eth2: Speed: 1000Mb/s Duplex: Full driver: e1000[Expert@gateway:0]#
No badges required for me
Thanks! This is extactly what I was looking for.
I've added this One-liner to our ccc-script.
Give the points/badge to Tim, all I did was make the output slightly prettier.
I gave Tim a badge with 1000 points.
Here's a somewhat cleaned-up version, and restricted to real NICs only (skips bonds, VLANs, loopback) :
[Expert@gateway:0]# ls /sys/class/net | xargs -I % sh -c "[ -e /sys/class/net/%/device ] && (ethtool % | egrep 'Settings|Speed|Duplex' | sed -r 's/\!( \(255\))?//'; echo -e '\t'; ethtool -i % | grep driver) | tr -d '\n' && echo"
Settings for Mgmt: Speed: 1000Mb/s Duplex: Full driver: igb
Settings for eth1: Speed: 1000Mb/s Duplex: Full driver: igb
Settings for eth2: Speed: 1000Mb/s Duplex: Full driver: igb
Settings for eth3: Speed: Unknown Duplex: Unknown driver: igb
Settings for eth4: Speed: 1000Mb/s Duplex: Full driver: igb
Settings for eth5: Speed: 1000Mb/s Duplex: Full driver: igb
And here's a more complete version (not sure this still registers as a one-liner though :P) :
[Expert@gateway:0]# (echo Interface Link Speed Duplex Auto-neg Driver; for n in /sys/class/net/*; do [ -e $n/device ] && (n=${n/*\/}; echo $(echo $n; e=$(ethtool $n); for i in 'Link detected' Speed Duplex 'Auto-negotiation'; do echo "$e" | sed -n "/\t$i: /{s///;s/\!//;s/ (255)//;p}"; done; ethtool -i $n | sed -n '/driver: /s///p')); done) | column -t
Interface Link Speed Duplex Auto-neg Driver
Mgmt yes 1000Mb/s Full on igb
eth1 yes 1000Mb/s Full on igb
eth2 yes 1000Mb/s Full on igb
eth3 no Unknown Unknown on igb
eth4 yes 1000Mb/s Full on igb
eth5 yes 1000Mb/s Full on igb
Indeed old habits die hard - in the Linux world ifconfig is long gone.
A fix would be (I will update the blog post as well) to replace ifconfig with ip add :
# 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
Settings for eth2:
Speed: 100Mb/s
Duplex: Full
BTW Regarding disabled/downed interfaces - I just couldn't think of possible reason to learn their state...
Thanks @https://community.checkpoint.com/people/dantr917b8439-9d5c-34f0-b86a-f0e1b0a14cbd for reminding me I have it at all .
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
User | Count |
---|---|
16 | |
11 | |
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
Tue 07 Oct 2025 @ 10:00 AM (CEST)
Cloud Architect Series: AI-Powered API Security with CloudGuard WAFThu 09 Oct 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: Discover How to Stop Data Leaks in GenAI Tools: Live Demo You Can’t Miss!Thu 09 Oct 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: Discover How to Stop Data Leaks in GenAI Tools: Live Demo You Can’t Miss!Wed 22 Oct 2025 @ 11:00 AM (EDT)
Firewall Uptime, Reimagined: How AIOps Simplifies Operations and Prevents OutagesAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY