• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >windows > 双网卡bond脚本

双网卡bond脚本

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含双网卡bond,双网卡脚本,双网卡同时上内外网,双网卡,双网卡设置等服务器相关知识,网友希望可以进行参考

本脚本用于实现网卡bonding 可以监控bonding 停止bonding


[root@crushlinux ~]# vi /etc/init.d/bond
#!/bin/bash
# chkconfig: 345 10 90
# description: Activates/Deactives bonding device
# filename: bond.sh
# auth: crushlinux
# date: 2013/09/28
IP=192.168.1.254
NETMASK=255.255.255.0
id root &>/dev/null||exit 1
start () {
/sbin/ifenslave bond0 &>/dev/null&&exit 0
/sbin/modprobe bonding mode=1 miimon=100
/sbin/ifconfig bond0 $IP netmask $NETMASK
/sbin/ifenslave bond0 eth0
/sbin/ifenslave bond0 eth1
}
stop () {
/sbin/ifenslave bond0 &>/dev/null||exit 1
/sbin/ifenslave -d bond0 eth0
/sbin/ifenslave -d bond0 eth1
/sbin/modprobe -r bonding
}
status () {
if
/sbin/ifenslave bond0 &>/dev/null
then
echo "Bonding is run"
echo "The ip address is `ifconfig bond0|grep 'inet addr'|awk '{print $2}'|awk -F: '{print $2}'`"
else
echo "Bonding is down"
fi
}
case $1 in
start)start;;
stop)stop;;
status)status;;
*)echo $"Usage: $0 {start|stop|status}"
esac
exit 0

将此脚本添加到chkconfig来管理

[root@crushlinux ~]# chmod a+x /etc/init.d/bond
[root@crushlinux ~]# chkconfig --add bond
[root@crushlinux ~]# chkconfig --list bond
[root@crushlinux ~]# service bond start
[root@crushlinux ~]# ifconfig


本文出自 “Crushlinux 工作室” 博客,谢绝转载!

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 双网卡bond脚本

相关文章

  • windows2003禁止关机时出现的关机理由
  • 解决dell服务器无法识别4G内存办法
  • Windows2003安装和使用FTP服务器(权限配置)
  • iis 您未被授权查看该页
  • 利用Flash media server 4.5配置流媒体服务器
  • Windows Server 2003 安装fastcgi图文详解
  • 正则表达式和grep的基本用法9
  • windows2003中带$符号的用户无法删除
  • Windows IIS如何设置CDN的CACHE过期时间
  • HA 高可用集群

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 无法打开登录所请求的数据库DbName的解决方法
    • 如何测试Lync Mobility功能是否正确
    • 多路径链路状态异常解决
    • xen server 存储库(sr)损坏的数据恢复方案
    • 关于VirtualBox的端口映射的那一点事儿
    • 华为数据中心:融合方案也分层次
    • Win7的telnet服务怎么打开,Windows7如何用Telnet
    • Windows 系统查看端口占用以及解决端口占用
    • 集群 之 LVS + Keepalived
    • linux apache 虚拟目录设置方法

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有