linux 下 ethtool 修改网卡eeprom
来源:互联网 发布:淘宝店铺发布微淘 编辑:程序博客网 时间:2024/06/04 17:49
ethtool 工具有一个-E 指令, 可以通过此指令修改网卡的eeprom. 前提是此网卡驱动编写了ethtool驱动接口,并具有eeprom.
以intel e1000系列网卡为例
首先取得e000设备的VenID:DevID, 这个VenID:DevID就是ethtool -E 指令中magic 的参数.
可以分别通过2种方式取得
1> lspci 查看
~# lspci -nn -v |grep "Ethernet Controller"
02:05.0 Ethernet controller [0200]: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) [8086:100f] (rev 01)
2> Intel 网卡eeprom已经包含了VenID:DevID, 具体可以查看每个网卡的芯片及开发手册
~# ethtool -e eth1 | grep 0x0010 | awk '{print "0x"$13$12$15$14}'
0x100f8086
也可在以下链接查阅到.
Intel® PRO/100, PRO/1000 & 10GbE Network Adapter ID and driver guide
获取到VenID:DevID后, 就可以直接修改了.
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 /<interface/>"
echo " i.e. $0 eth0"
exit 1
fi
if ! ifconfig $1 > /dev/null; then
exit 1
fi
dev=$(ethtool -e $1 | grep 0x0010 | awk '{print "0x"$13$12$15$14}')
ethtool -E $1 magic $dev offset 0xAA value 0xBB
0xAA 就是eeprom位置
0xBB 就是新值
版权声明:本文为博主原创文章,未经博主允许不得转载。
0 0
- linux 下 ethtool 修改网卡eeprom
- linux 下 ethtool 修改网卡eeprom
- linux 下 ethtool 修改网卡eeprom
- Linux下千兆网卡和万兆网卡ethtool对比
- linux 网卡参数 ethtool
- linux网卡信息-ethtool
- ethtool ---网卡配置查看及修改工具
- ethtool---查看网卡以及修改网卡配置工具
- Linux 下修改网卡MAC
- linux下修改网卡名称
- Linux下修改网卡设定
- linux下 读取EEPROM
- Centos 6.5 下通过ethtool限制网卡速率
- Linux 内核ethtool框架新增刷网卡firmware功能
- 查看linux系统网卡工作模式、速率等ethtool eth0
- Linux 查看网卡接收报文信息命令ethtool
- 嵌入式LINUX网卡设置工作模式之Ethtool
- linux+arm 网卡故障调试:ethtool&phy寄存器读写
- html转义字符
- 黑马程序员-继承、接口与多态
- TabHost的一点注意事项
- 你刚才在淘宝上买了一件东西【技术普及贴】
- Unity3d开发(三)GameObject 作函数参数
- linux 下 ethtool 修改网卡eeprom
- 文件上传
- chrome插件开发杂记
- Objective-C 学习笔记二
- 创建一个sms.db数据库俩面在创建一个message表,插入数据然后在读取数据
- 为什么很多看起来不是很复杂的网站,比如 Facebook 需要大量顶尖高手来开发?
- Eclipse中常用的快捷键
- sicily 1176. Two Ends
- a标签中有点击(onclick)事件