Yuri Slobodyanyuk Blog on Information Security 2024年09月12日
Check duplex and speed settings of all interfaces in one go
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

介绍了在检查Checkpoint防火墙或其他网络设备的连接性问题时,如何一次性获取多个接口的速度和双工参数的方法。

🥇通过特定命令行语句,可一次性获取所有接口的速度和双工设置参数。如使用'for ii in $(ifconfig|awk '/Ethernet/{print$1}');do ethtool $ii;done|egrep 'eth|Speed|Duplex''命令。

🥈文中列举了多个接口(eth0、eth1等)的速度和双工参数的具体情况,如eth0的速度为100Mb/s,双工为Full等。

🥉还提到了另一种通过ipaddress命令的方式,如'for ii in $(ipaddress|awk -F: '/UP/{print$2}');do ethtool $ii;done|egrep 'Settings|Speed|Duplex'',并展示了部分接口的设置情况。

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: FullSettings for eth5:        Speed: 1000Mb/s        Duplex: Full

Follow me on https://www.linkedin.com/in/yurislobodyanyuk/ not to miss what I publish on Linkedin, Github, blog, and more.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Checkpoint防火墙 接口连接性 速度与双工参数 命令行操作
相关文章