centos7網路問題

2022-09-07 08:24:13 字數 1338 閱讀 4853

- 原因:centos7裡邊是沒有安裝ifconf。

- 安裝ifconfig

1、yum search ifconfig 搜尋ifconfig所在包

2、根據所在包安裝

yum install net-tools.x86_64

- 原因:centos7預設沒有開啟網絡卡

- 操作步驟:

1、vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 (enp0s3可能會不一樣)

2、onboot預設為no不確定網絡卡,改為yes

3、重啟網絡卡命令:service network restart

proxy_method=none

browser_only=no

bootproto="static" # 使用靜態ip位址,預設為dhcp

ipaddr="192.168.241.100" # 設定的靜態ip位址

netmask="255.255.255.0" # 子網掩碼

gateway="192.168.241.2" # 閘道器位址

dns1="192.168.241.2" # dns伺服器

defroute=yes

ipv4_failure_fatal=no

ipv6init=yes

ipv6_autoconf=yes

ipv6_defroute=yes

ipv6_failure_fatal=no

ipv6_addr_gen_mode=stable-privacy

name=enp0s3

uuid=f3aa1bcf-d714-46f4-85c4-51f8ffcc0137

device=enp0s3

onboot=yes

4、臨時配置ip

ifconfig eth0 192.168.100.10 netmask 255.255.255.0 或者 ifconfig eth0 192.168.100.10/24

5、修改主機名:

[root@mrxw ~]# cat /etc/sysconfig/network

networking=yes 

hostname=主機名

centOS7網路配置

開啟 etc sysconfig network scripts ifcfg eno xx 將bootprotot的值改為static 將onboot的值改為yes 尾部新增 ipaddr x.x.x.x gateway x.x.x.x netmask x.x.x.x 儲存退出 用以下命令重啟網路 ...

CentOS 7網路配置

剛安裝的centos7首先遇到的問題是 網路配置。如何讓新系統連線到網路?這裡配置的環境是基於vmware上安裝的centos,當然不在虛擬機器上的centos安裝後的網路配置方式也是一樣的。1 首先安裝的一般版本 除gnome kde圖形介面之外 是不帶圖形介面的,此時字元介面下ifconfig命...

Centos7 網路配置

配置網絡卡bootproto static onboot yes ipaddr 192.168.2.152 netmask 255.255.0.0 gateway 192.168.0.1 dns1 218.2.135.1 dns2 114.114.114.114 重啟networksystemctl...