zoukankan      html  css  js  c++  java
  • Centos配置网卡子接口

    1、检查OS是否加载802.1q模块:

    方法一:

    [root@rs2 ~]# modinfo 8021q

    方法二:

    [root@rs2 ~]# modinfo -F filename 8021q

     

    方法三:

    [root@rs2 ~]# modprobe --first-time 8021q

     

    2、如果没有加载如何加载802.1q模块:

    [root@rs2 ~]# modprobe 8021q           ###加载模块

    [root@rs2 ~]# lsmod | grep 8021q          ##检查模块是否正常加载

    3、在父接口中创建子接口:

    [root@rs2 ~]# cd /etc/sysconfig/network-scripts/

    [root@rs2 network-scripts]# cp ifcfg-eno16777736 ifcfg-eno16777736.bak      ##备份网卡配置

    [root@rs2 network-scripts]# vi ifcfg-eno16777736           #配置父接口

    TYPE=Ethernet

    BOOTPROTO=none

    NAME=eno16777736

    DEVICE=eno16777736

    ONBOOT=yes

    [root@rs2 network-scripts]# vi ifcfg-eno16777736.100         #配置子接口,100表示vid

    BOOTPROTO=none

    NAME=eno16777736.100

    DEVICE=eno16777736.100

    ONBOOT=yes

    IPADDR=192.168.10.20

    PREFIX=24

    NETWORK=192.168.10.1

    VLAN=yes                                    ###开启vlan,表示此接口为vlan接口

    4、重启网络:

    systemctl restart network

  • 相关阅读:
    DockerFile 解析
    Docker 容器数据卷
    Docker 镜像
    Docker 常用命令
    Docker 安装
    vue全站式笔记
    接口环境配置
    前端跨域的三种方式
    vue+axios 模拟后台返回数据的三种方式:本地创建json、easymock平台、mockjs
    cookie、sessionStorage与localStorage是什么?
  • 原文地址:https://www.cnblogs.com/good-study/p/10313410.html
Copyright © 2011-2022 走看看