cent os下面的基本配置操作

时间:2022-03-19 16:47:44
二,修改Linux分辨率命令行
在root用户模式下,输入$ vi /boot/grub/grub.conf(路径可能会不一样,也可以是 /etc/grub.conf),打开grub.conf文件

我们修改分辨率,需要在kernel那行加入 vga=791

cent os下面的基本配置操作

三配置网络

找到 /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens33
UUID=012d4f52-bbd0-4d11-b2dc-b83f00208f9f
DEVICE=ens33
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.121
GATWAY=192.168.1.1
DNS=8.8.8.8

重启 就可以连上局域网了。

四 安装ifconfig命令

新安装centos时找不到 ifconfig命令

需要安装 具体操作时 yum install net-tools命令 ok

[root@localhost network-scripts]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.121 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fe33:58fa prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:33:58:fa txqueuelen 1000 (Ethernet)
RX packets 1218 bytes 131957 (128.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 282 bytes 56872 (55.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@localhost network-scripts]#

最后还是有问题,在虚拟机里面不能访问外网,是网关没有配配置好

必须改vi /etc/sysconfig/network

加上

NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1

重启网络服务

service network restart

[root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (119.75.217.109) 56(84) bytes of data.
64 bytes from 119.75.217.109: icmp_seq=1 ttl=54 time=46.5 ms
64 bytes from 119.75.217.109: icmp_seq=2 ttl=54 time=48.0 ms
^C

搞定