0
点赞
收藏
分享

微信扫一扫

Centos网络的配置,不会你打我



主要以centos镜像的操作,对其他镜像可能不适用



文章目录

  • ​​????方法1:修改配置文件来配置IP地址​​
  • ​​IP获取的2种方式​​
  • ​​第一种:​​
  • ​​第二种:​​
  • ​​修改网络配置文件​​
  • ​​网卡操作​​
  • ​​????️方法2:nmtui图形化配置网络(直接在命令行输入nmtui)​​
  • ​​网络源配置:​​

????方法1:修改配置文件来配置IP地址

​vi /etc/sysconfig/network-scripts/ifcfg-eth0BOOTPROTO=dhcp​

IP获取的2种方式

第一种:

ifconfig

第二种:

​ip add​

修改网络配置文件

#dhcp、static、noneONBOOT=no   
#要不要默认启动此接口static:
IPADDR=192.168.43.10
NETMASK=255.255.255.0
GATEWAY=192.168.43.1
DNS1=192.168.43.1

网卡操作

systemctl restart network  
systemctl start network
systemctl stop network

????️方法2:nmtui图形化配置网络(直接在命令行输入nmtui)

Centos网络的配置,不会你打我_ip地址

网络源配置:

yum -y install wgetcd /etc/yum.repos.d/wget http://mirrors.163.com/.help/CentOS7-Base-163.repowget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repoyum

清除源

clean allyum makecache



举报

相关推荐

0 条评论