zoukankan      html  css  js  c++  java
  • centos7修改网卡名称

    修改网卡文件名

    cd /etc/sysconfig/network-scripts/ 
    mv ifcfg-ens33 ifcfg-eth0 
    mv ifcfg-ens34 ifcfg-eth1
    

      

    修改网卡文件内容

    cat > ifcfg-eth0<<END 
    	TYPE=Ethernet
    	BOOTPROTO=none
    	DEFROUTE=yes
    	IPV4_FAILURE_FATAL=no
    	NAME=eth0
    	DEVICE=eth0
    	ONBOOT=yes
    	IPADDR=10.0.0.201
    	PREFIX=24
    	GATEWAY=10.0.0.254
    	DNS1=223.5.5.5
    	DNS2=223.6.6.6
    	END
    	[root@CentOS7 network-scripts]#
     cat  >ifcfg-eth1<<END
    	TYPE=Ethernet
    	BOOTPROTO=none
    	DEFROUTE=yes
    	IPV4_FAILURE_FATAL=no
    	NAME=eth1
    	DEVICE=eth1
    	ONBOOT=yes
    	IPADDR=172.16.1.200
    	PREFIX=24
    	END
    

    修改并生成grub配置

    [root@CentOS7 network-scripts]# vim   /etc/sysconfig/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="rhgb net.ifnames=0 biosdevname=0 quiet"
    GRUB_DISABLE_RECOVERY="true"
    [root@CentOS7 network-scripts]# 
    

    生成grub启动菜单

    [root@CentOS7 network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-4860b79d6cd240788b962a1dbdef488d
    Found initrd image: /boot/initramfs-0-rescue-4860b79d6cd240788b962a1dbdef488d.img
    done
    [root@CentOS7 network-scripts]# 
    

     

    安装ifconfig

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    yum install wget net-tools vim bash-completion lrzsz nmap nc tree -y
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    sed -i.ori 's#SELINUX=enforcing#SELINUX=disabled#' /etc/selinux/config
    

    重启系统

    reboot
    

      

  • 相关阅读:
    vscode如何将less编译到指定css目录中
    md文档的书写《二》
    关于页面scroolTop的获取
    git学习 c的某位老哥的,(侵删)
    学习git使用网址
    git,github,gitlab,码云的区别
    Git的基本使用
    php_review_day1
    shell脚本编程基础-构建基本脚本
    Linux基本命令
  • 原文地址:https://www.cnblogs.com/lijiansheng/p/10821410.html
Copyright © 2011-2022 走看看