日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

CentOS 7 配置網(wǎng)卡

 rongq2007 2019-08-14

VM安裝了一個Linux系統(tǒng)CentOS,但是安裝后發(fā)現(xiàn)ping www.baidu.com 報錯 。查了一下發(fā)現(xiàn)需要配置網(wǎng)卡。

1.首先需要進(jìn)入目錄 /etc/sysconfig/network-scripts

這里我的centos的 iso版本是:CentOS-7-x86_64-DVD-1708.iso。進(jìn)入目錄之后可以看到有個ifcfg-ens33的文件。我們需要對這個文件做些修改。

2.vi ifcfg-ens33

這里主要需要修改幾個地方。

a.由于我要配置的靜態(tài)的IP,所以BOOTPROTO=static。

b.ONBOOT=yes。默認(rèn)為no,開啟網(wǎng)絡(luò)連接。 

d.IPADDR,NETMASK,GATEWAY,DNS1,DNS2參考修改

7.重啟network service

service network restart.

8.測試ping

ping www.baidu.com

注:這里我VM里面的網(wǎng)卡配置的橋接方式。

centos7的網(wǎng)卡重啟方法

1、centos6的網(wǎng)卡重啟方法:service network restart
      
centos7的網(wǎng)卡重啟方法:systemctl restart network

2關(guān)閉防火墻并設(shè)置開機(jī)不啟動

查看防火墻狀態(tài):systemctl status firewalld.service
關(guān)閉:systemctl stop firewalld
開啟:systemctl start firewalld
開機(jī)自動關(guān)閉:systemctl disable firewalld
開機(jī)自動啟動:systemctl enable firewalld
查看開機(jī)是否啟動:chkconfig --list|grep network(RHLE6)

firewalld 基本使用
啟動: systemctl start firewalld
查看狀態(tài): systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld

centos6

關(guān)閉虛擬機(jī)防火墻:

關(guān)閉命令:  service iptables stop

永久關(guān)閉防火墻:chkconfig iptables off

兩個命令同時運(yùn)行,運(yùn)行完成后查看防火墻關(guān)閉狀態(tài)

service iptables status

1 關(guān)閉防火墻-----service iptables stop 

2 啟動防火墻-----service iptables start 

3 重啟防火墻-----service iptables restart 

4 查看防火墻狀態(tài)--service iptables status 

5 永久關(guān)閉防火墻--chkconfig iptables off 

6 永久關(guān)閉后啟用--chkconfig iptables on

 ———————————————— 

SELinux

  • 臨時關(guān)閉SELinux 
    setenforce 0

  • 臨時打開SELinux 
    setenforce 1

  • 查看SELinux狀態(tài) 
    getenforce

  • 開機(jī)關(guān)閉SELinux 
    編輯/etc/selinux/config文件,如下圖,將SELINUX的值設(shè)置為disabled。下次開機(jī)SELinux就不會啟動了。

  安裝vim

yum install -y vim*

Vim 的全局配置一般在 /etc/vim/vimrc 或者 /etc/vimrc

VIM配置入門

centos7 Mariadb5.5升級到Mariadb10.2

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多