CentOS下双网卡设置方法
来源:互联网 发布:电视台直播软件 编辑:程序博客网 时间:2024/04/30 08:27
CentOS 双网卡双 IP 设置, 网络上找的基本比较含糊.
最近在弄 openstackEssex, 用到了双网卡双 IP, 在此做个备忘.
系统环境: CentOS6.3
网络环境: 两个 IP 地址(双网卡),192.168.30.155 和 111.111.10.6, 掩码是 255.255.255.0
这两个子网的网关地址分别是:192.168.30.1 和 111.111.10.1
1. 为网卡 eth0 配置 ip 地址192.168.30.155, 为网卡 eth2 配置 ip 地址为111.111.10.6配置文件为:
/etc/sysconfig/network-scripts/ifcfg-em1
/etc/sysconfig/network-scripts/ifcfg-em2
2. 配置默认网关为任意一个. 这个默认网关, 决定了系统主动去使用网络时, 使用的接口.
修改配置文件: /etc/sysconfig/network, 添加内容:
GATEWAYDEV=eth0
3. 编辑路由表
修改/etc/iproute2/rt_tables, 添加内容:
252 net2
251 net3
修改/etc/rc.local 添加原路返回路由
iproute flush table net2
ip route add defaultvia 192.168.30.1 dev eth0 src 192.168.30.155 table net2
iprule add from 192.168.30.155 table net2
iproute flush table net3
ip route add defaultvia 111.111.10.1 dev eth2 src 111.111.10.6 table net3
iprule add from 111.111.10.6 table net3
4. 最后记得重启机器
- CentOS下双网卡设置方法
- 在centos下更换网卡设置
- LINUX CENTOS下单网卡设置多个IP的方法(REDHAT)
- CentOS 双网卡双 IP 设置
- CentOS 双网卡双 IP 设置
- CentOS双网卡双IP设置
- CentOS 双网卡双 IP 设置
- centos 设置双网卡,双网关
- ubuntu/centos 上的双网卡设置
- CentOS系统双网卡路由设置
- centos设置双网卡绑定band0
- centos 网卡设置
- centos无线网卡设置
- [centos] 网卡设置学习
- Linux下设置双网卡
- Linux下设置双网卡
- 双网卡的设置方法
- [Linux]CentOS下双网卡,双路由的设置与保存
- 迭代器报“vector iterators incompatible”错的几种可能
- Ubuntu12.04安装vnc Server
- java 参数传递
- Android APK包名修改
- AJAX了解与用法
- CentOS下双网卡设置方法
- oracle银行卡卡号计算函数
- 性能测试监控:Linux/unix监控工具nmon
- JS 获取节点属性值
- win7+vs2010+Qt addin新建win32控制台程序编译出错问题
- Longest Palindromic Substring
- gitlab 一键安装
- jQuery简单邮箱验证
- 这才是真正的裸眼3D!超级震撼!!