Ubuntu虚拟机多网卡配置
来源:互联网 发布:手写电子笔记软件 编辑:程序博客网 时间:2024/05/17 08:10
1、场景说明
系统平台:Ubuntu16.04
服务器:VMWare workstation 虚拟机12c
解决问题:添加4块网卡(四个网段、四个网关),第4个网卡nat上网,但是默认路由有问题
2、网卡配置内容
root@Ocommon:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interfaceauto loiface lo inet loopback# The primary network interface#auto ens32iface ens32 inet staticaddress 1.1.1.2netmask 255.255.255.0gateway 1.1.1.1#auto ens33iface ens33 inet staticaddress 2.2.2.2netmask 255.255.255.0gateway 2.2.2.1#auto ens34iface ens34 inet staticaddress 3.3.3.2netmask 255.255.255.0gateway 3.3.3.1#auto ens35iface ens35 inet dhcp
注意:
但是在都添加“#auto ens3*”后启动就会出现错误,所以将#auto ens3*全部去掉,但是启动就出现不能网卡不能正常显示。
3、Ubuntu虚拟机多网卡配置补充内容
按照以上配置Ubuntu16.04虚拟机网卡配置后,需要解决网卡启动,多网段路由问题
cat >/etc/init.d/configNetwork<<EOF11ifup ens32ifup ens33ifup ens34ifup ens35route add -net 1.1.1.0 gw 1.1.1.1route add -net 2.2.2.0 gw 2.2.2.1route add -net 3.3.3.0 gw 3.3.3.1route del default gw 1.1.1.1 route add default gw 192.168.137.2 dev ens35EOF11chmod 111 /etc/init.d/configNetworksed -i '/exit 0/i\bash /etc/init.d/configNetwork' /etc/rc.local
以上配置实现了:
1)系统启动时,运行自定义的脚本(Ubuntu16.04启动执行脚本略有差异)
2)系统启动时脚本执行启动网卡动作
3)系统实现多网段各自通信,每次启动修改默认网关
1 0
- Ubuntu虚拟机多网卡配置
- 虚拟机+ubuntu下双网卡配置笔记
- ubuntu 虚拟机网卡
- Win7+VMWare虚拟机+Ubuntu系统+双网卡配置
- VirtualBox上Ubuntu Server虚拟机配置双网卡
- VirtualBox上Ubuntu Server虚拟机配置双网卡
- 虚拟机centos网卡配置
- Ubuntu网卡配置
- ubuntu网卡配置
- Ubuntu网卡配置
- UBUNTU SERVER 配置网卡
- Ubuntu配置双网卡
- ubuntu 双网卡配置
- ubuntu 双网卡配置
- ubuntu网卡配置模式
- ubuntu双网卡配置
- Ubuntu配置双网卡
- ubuntu配置无线网卡
- 51nod 1082 与7无关的数【暴力打表】
- 监控文本改变事件
- AABB&OBB碰撞
- 简单4步,配置NGNIX,让新的域名指向主机的虚拟目录
- Git快速入门知识
- Ubuntu虚拟机多网卡配置
- VC++学习笔记5
- 窗口泄露问题
- 两个Integer 用== 比较不相等的原因
- 历史数据迁移 使用触发器 trigger 示例
- 递归小李子
- 快速读入
- 第7章 sed、gawk介绍与正则表达式-----------(gawk编辑器简单使用)
- 动态加载页面-使用jquery ajax