Linux网卡切换测试
来源:互联网 发布:在线数据库设计 编辑:程序博客网 时间:2024/05/29 18:27
--登录Linux
--进入/etc/sysconfig/network-scripts/目录
[root@test] cd /etc/sysconfig/network-scripts/
[root@test network-scripts]# ls
ifcfg-bond0 ifcfg-eth3 ifdown-eth ifdown-post ifdown-tunnel ifup-eth ifup-plip ifup-routes init.ipv6-global
ifcfg-eth0 ifcfg-lo ifdown-ippp ifdown-ppp ifup ifup-ippp ifup-plusb ifup-sit net.hotplug
ifcfg-eth1 ifdown ifdown-ipv6 ifdown-routes ifup-aliases ifup-ipv6 ifup-post ifup-tunnel network-functions
ifcfg-eth2 ifdown-bnep ifdown-isdn ifdown-sit ifup-bnep ifup-isdn ifup-ppp ifup-wireless network-functions-ipv6
--查看bond配置信息(可能有多个bond)
[root@test network-scripts]# more ifcfg-bond0
DEVICE=bond0
BONDING_OPTS="mode=1 miimon=100"
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR= xxxx
NETMASK= xxxx
GATEWAY= xxxx
IPV6INIT=no
USERCTL=no
--查看bond目前状态,当前状态是eth2是工作状态,eth1和2状态都是up
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
--将eth2 down掉,再查看bond状态,eth1变成工作状态,eth2状态变成down状态
[root@test network-scripts]# ifconfig eth2 down
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: down
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
--将eth2启动,查看bond信息,eth1还是工作状态,eth2恢复up状态
[root@test network-scripts]# ifconfig eth2 up
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
--同理,关闭eth1,查看bond状态
[root@test network-scripts]# ifconfig eth1 down
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: down
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
--启动eth1,查看bond状态(bond状态中eth1的状态有可能有延时,多试两次)
[root@test network-scripts]# ifconfig eth1 up
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
[root@test network-scripts]#
--进入/etc/sysconfig/network-scripts/目录
[root@test] cd /etc/sysconfig/network-scripts/
[root@test network-scripts]# ls
ifcfg-bond0 ifcfg-eth3 ifdown-eth ifdown-post ifdown-tunnel ifup-eth ifup-plip ifup-routes init.ipv6-global
ifcfg-eth0 ifcfg-lo ifdown-ippp ifdown-ppp ifup ifup-ippp ifup-plusb ifup-sit net.hotplug
ifcfg-eth1 ifdown ifdown-ipv6 ifdown-routes ifup-aliases ifup-ipv6 ifup-post ifup-tunnel network-functions
ifcfg-eth2 ifdown-bnep ifdown-isdn ifdown-sit ifup-bnep ifup-isdn ifup-ppp ifup-wireless network-functions-ipv6
--查看bond配置信息(可能有多个bond)
[root@test network-scripts]# more ifcfg-bond0
DEVICE=bond0
BONDING_OPTS="mode=1 miimon=100"
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR= xxxx
NETMASK= xxxx
GATEWAY= xxxx
IPV6INIT=no
USERCTL=no
--查看bond目前状态,当前状态是eth2是工作状态,eth1和2状态都是up
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
--将eth2 down掉,再查看bond状态,eth1变成工作状态,eth2状态变成down状态
[root@test network-scripts]# ifconfig eth2 down
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: down
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
--将eth2启动,查看bond信息,eth1还是工作状态,eth2恢复up状态
[root@test network-scripts]# ifconfig eth2 up
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
--同理,关闭eth1,查看bond状态
[root@test network-scripts]# ifconfig eth1 down
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: down
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
--启动eth1,查看bond状态(bond状态中eth1的状态有可能有延时,多试两次)
[root@test network-scripts]# ifconfig eth1 up
[root@test network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: xxxx
Slave queue ID: 0
[root@test network-scripts]#
0 0
- Linux网卡切换测试
- linux 网卡配置 和切换
- Linux测试网卡绑定
- Linux 双网卡绑定测试
- 测试Linux网卡是否正常工作
- linux 网卡ppp0与ppp1来回切换、不断重连
- Linux基础之无线网卡配置连接测试相关操作
- 批处理切换无线网卡和有线网卡
- xp更改首选网卡 网卡切换
- linux网卡
- linux 网卡
- linux网卡
- Linux 网卡
- windows批处理网卡切换脚本
- linux下将无线网卡工作模式切换为监听模式
- Linux中切换网卡工作模式及查看HBA卡驱动型号
- netio 网卡性能测试
- 测试网卡流量脚本
- 九度OJ 1040:Prime Number(质数) (递归)
- Gson之TypeAdapterFactory
- 如何实现支持数亿用户的长连消息系统
- 创建数据库与完成数据添删改查(一)
- web.xml中listener, filter, servlet加载顺序
- Linux网卡切换测试
- 每周更新知识
- opencv 2 学习笔记1
- shell let expr $(()) 命令
- DayDayUP_Linux运维学习_DNS安装与使用
- 用整数类型处理货币
- CAS单点登录那点事(一)
- CocoaPods安装和使用
- 【IOS 开发学习总结-OC-56】故事板storyborad的segue