CentOs7中的网卡配置工具

摘自:https://blog.51cto.com/13572810/2087991

一,CentOs7中的网卡配置工具

介绍之前,先来了解一下NetworkManager,Network Manager 是管理和监控网络设置的首行进程,设备既是网络接口,链接是对网络接口的配置,一个网络接口可以有多个链接配置,但同时只有一个链接配置生效

chkconfig NetworkManager off  保证下一次开机服务仍然关闭

chkconfig NetworkManager on  保证下一次开机服务仍然开启,红帽开启这个才有小图标

  1. nmcli 地址配置工具

  2. nmcli常用选项

    看一下具体用法

    nmcli device = nmcli device status 显示网络接口

    nmcli device show 显示网卡设备详细信息

    nmcli connection 显示网卡配置文件名

    nmcli connection modity 修改配置文件名

    nmcli connection add 增加一个配置文件名

    nmcli connection up 激活配置文件链接

    手动设置自动链接的配置文件

    nmcli connection modity  修改地址

    nmcli connection modity +ipv4  增加IP地址

  3. 修改配置文件执行生效

    systemctl restart network

    nmcli con reload

  4. 创建bond

    bond 绑定,将多块我昂卡绑定同一个IP地址对外提供服务,通过bonding虚拟一块网卡,并不是直接设置同一个IP地址

    nmcli connection add con-name bond0 type bond ifame bond0 mode active-backup    添加bonding主接口

    nmcli connection add type bond-slave ifname ens33 master bond0    添加bonding从属接口

    nmcli connection add tyoe bond-slave ifname ens34 master bon0    第二个从属接口

    nmcli connection up bond-slave-ens33    先启动俩个从属接口,然后启动bond

    nmcli connection up bond-slave-ens34

    nmcli connection up mybond0    启动bond

    cat /proc/net/bonding/bong0    查看bond状态

  5. 创建team

    network team 网络组,将多个网卡聚合在一起的方法

    nmcli connection add con-name team0-con1 type team ifname team0 config    创建网络组接口

    team0-con1    连接名

    config    指定runner的方式    格式 {"runner":{"name":"method"}}

    method的多种

    broadcast   roundrobin   activebackup   loadbalance

    nmcli connection add type team-slave ifname ens33 master team0    创建port(数据)接口

    team-slave    连接名不指定,默认为team0-slave-ens33

    nmcli connection modity team0-con1 ipv4.addresses 8.8.8.9/24    设置接口ipv4地址

    teamdctl team0 state    查看team0状态

    teamdctl    管理team的工具

  6. 创建bridge

    bridge  网桥,类似于交换机,虚拟机里的桥接,交换机的前身

    作用,俩个网络有所连接,在Linux上需要自己创建

nmcli connection add type bridge con-name br0-con ifname br0 ipv4.method manual ipv4.addresses 8.8.8.6/24    添加网桥接口并且手动设置IP地址

nmcli connection add type bridge-slave ifname eth2 master br0    添加俩个网桥从属接口

nmcli connection add type bridge-slave ifname eth3 master br0

nmcli connection up br0-con    激活网桥接口

brctl show  查看网桥

brctl delbr br0   删除网桥

brctl delif eth0   删除网桥中网卡

CentOs7中的网卡配置工具的更多相关文章

  1. centos7中安装、配置、验证、卸载redis

    本文介绍在centos7中安装.配置.验证.卸载redis等操作,以及在使用redis中的一些注意事项. 一 安装redis 1 创建redis的安装目录 利用以下命令,切换到/usr/local路径 ...

  2. linux的服务管理(centos6和Centos7)和网络管理(网卡配置),计划服务cron

    服务和网络 管理 init  ifcfg ens33 1.服务: Linux系统中提供的功能,统称为服务,如:at服务.cron服务.web服务.FTP服务.sshd服务等. 服务是由已经在运行的进程 ...

  3. centos7中的网卡一致性命名规则、网卡重命名方法

    一致性网络设备命名(Consistent Network Device Naming) 背景介绍: 在centos5的时候,我们习惯了eth0这样的网络设备命名,在centos6发现网络设备变成了em ...

  4. centos7中的网卡名称相关知识

    转载自https://www.cnblogs.com/zyd112/p/8143464.html 一致性网络设备命名(Consistent Network Device Naming) 背景介绍: 在 ...

  5. CentOS7中OpenVPN的配置

    最近需要在openstack中集成openvpn功能,故熟悉了一下openvpn的搭建流程,记录下来,供参考 版本:openvpn-2.3.4.tar.gz 下载地址:http://pan.baidu ...

  6. RHEL7/CentOS7中更改网卡默认名称

    1.重命名并修改网卡配置文件,将"NAME"参数更为我们熟悉的“eth*”,这里我将其改为"eth0" [root@localhost ~]# cd /etc/ ...

  7. centos7中安装、配置jdk(转载)

    参考命令:http://www.jb51.net/os/RedHat/73016.html来进行安装 安装说明 系统环境:centos7安装方式:rpm安装软件:jdk-8u25-linux-x64. ...

  8. CentOS7中PPTP的配置

    最近做各种vpn,记录一下pptp的流程 1.准备 #yum install -y perl ppp iptables //centos默认安装了iptables和ppp   2.安装pptpd #y ...

  9. centos7中redis安装配置

    1.官网下载对应版本,本例以5.0.5为例 2.tar -zxvf xxxxx 并mv到安装目录 3.进入redis-5.0.5目录下,执行编译命令 make 4.编译完成后,经redis安装到指定目 ...

随机推荐

  1. 异步与websocket

    异步与WebSockets 知识点 理解同步与异步执行过程 理解异步代码的回调写法与yield写法 Tornado异步 异步Web客户端AsyncHTTPClient tornado.web.asyn ...

  2. 28. 表单css样式定义格式

    form>table>tbody>tr>td{padding:5px;font-size:14px;font-family:"Microsoft YaHei" ...

  3. HTML5 Canvas 小例子 旋转的图片

    <一>CSS部分 @charset "utf-8"; *{ padding:; margin:; outline: none; } #canvas{ position: ...

  4. Laravel基础

    一.Laravel核心目录文件介绍 app:程序的核心代码和业务逻辑代码,其中的Http目录是我们业务逻辑的存放点 bootstrap:包含框架启动的和自动加载文件 config:包含所有程序中的配置 ...

  5. apache http get 和 post 请求

    1.首先要把jar依赖进项目 <dependency> <groupId>org.apache.httpcomponents</groupId> <artif ...

  6. Unable to open file '.RES'

    Unable to open file '.RES' 另存工程,带来的隐患,工程图标也改不了. 搜索发现源码里某个man.cpp里带了prgram  resource aaa.res,换成新工程文件名 ...

  7. VBA 操作 VBE

    Introduction You can write code in VBA that reads or modifies other VBA projects, modules, or proced ...

  8. How to read very large text files fast

    Question Does anyone know the fastest way to read large text files (10Mb) into a string.Readln is ju ...

  9. ArcGIS案例学习1_2

    ArcGIS案例学习1_2 联系方式:谢老师,135_4855_4328, xiexiaokui#qq.com 时间:第一天下午 案例1:矢量提取,栅格提取和坐标系投影变换 目的:认识数据类型 教程: ...

  10. substring_index 用法

    substring_index http://blog.csdn.net/wolinxuebin/article/details/7845917 1.substring_index(str,delim ...