Linux基本设置

307 阅读1分钟

一、用户名 1.vi /etc/sysconfig/network

修改为: NETWORKING=yes HOSTNAME=master

2.vi /etc/hosts 添加192.168.194.10 master

  1. vi /etc/hostname 修改为master

二、网卡名

1.vi /etc/default/grub

GRUB_CMDLINE_LINUX 加上 net.ifnames=0 biosdevname=0

修改后为 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"

2.重新加载配置 grub2-mkconfig -o /boot/grub2/grub.cfg

3.vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

修改为修改为

NAME=eth0 DEVICE=eth0

4.vim /etc/udev/rules.d/90-eno-pix.rules 修改name为eth0

三、查看系统版本 cat /etc/redhat-release

1、关闭firewall:

#停止firewall systemctl stop firewalld.service

#禁止firewall开机启动 systemctl disable firewalld.service

#查看默认防火墙状态(关闭后显示notrunning,开启后显示running) firewall-cmd --state