标签:port 登录 tin root 文件 提示信息 network eth0 name
最小化安装没有安装vim,暂时使用vi
进入到network-scripts 目录
[root@node1 ~]# cd /etc/sysconfig/network-scripts/
[root@node1 network-scripts]#
修改网卡配置文件名称
[root@node1 network-scripts]# ls ifcfg-eno16777736 ifdown-ippp ifdown-sit ifup-bnep ifup-plip ifup-Team network-functions-ipv6 ifcfg-lo ifdown-ipv6 ifdown-Team ifup-eth ifup-plusb ifup-TeamPort ifdown ifdown-isdn ifdown-TeamPort ifup-ib ifup-post ifup-tunnel ifdown-bnep ifdown-post ifdown-tunnel ifup-ippp ifup-ppp ifup-wireless ifdown-eth ifdown-ppp ifup ifup-ipv6 ifup-routes init.ipv6-global ifdown-ib ifdown-routes ifup-aliases ifup-isdn ifup-sit network-functions
[root@node1 ~]# mv ifcfg-eno16777736 ifcfg-eth0
在 /etc/sysconfig/grub 中的GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root 后加入 net.ifnames=0 biosdevname=0
[root@node1 ~]# vim /etc/sysconfig/grub GRUB_TIMEOUT=5 GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root net.ifnames=0 biosdevname=0 rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet" GRUB_DISABLE_RECOVERY="true"
执行 grub2-mkconfig -o /boot/grub2/grub.cfg 生效
[root@node1 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-1eb921a2f2804943984cf324014cbeab Found initrd image: /boot/initramfs-0-rescue-1eb921a2f2804943984cf324014cbeab.img done
修改网卡配置文件
[root@node1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 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=eth0 DEVICE=eth0 ONBOOT=yes IPADDR=10.0.0.21 NETMASK=255.255.255.0 GATEWAY=10.0.0.2 DNS1=192.168.1.1
重启网卡
[root@node1 ~]# systemctl restart network
查看IP
[root@node1 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:29:39:b8 brd ff:ff:ff:ff:ff:ff inet 10.0.0.20/24 brd 10.0.0.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe29:39b8/64 scope link valid_lft forever preferred_lft forever
查看网络是否连接
[root@node1 ~]# ping www.baidu.com PING www.baidu.com (220.181.112.244) 56(84) bytes of data. 64 bytes from 220.181.112.244: icmp_seq=1 ttl=128 time=1.50 ms 64 bytes from 220.181.112.244: icmp_seq=2 ttl=128 time=1.67 ms 64 bytes from 220.181.112.244: icmp_seq=3 ttl=128 time=1.75 ms
更改主机名
[root@node1 ~]# hostname node1
[root@node1 ~]# vim /etc/hostname
node1
关闭防火墙
[root@node1 ~]# systemctl stop firewalld
开启防火墙
[root@node1 ~]# systemctl enable firewalld
关闭SElinux
[root@node1 ~]# vim /etc/selinux/config SELINUX=disabled [root@node1 ~]# getenforce Disabled
更改登录提示信息
[root@node1 ~]# vim /etc/motd
加入需要提示的信息
删除登录时提示版本信息
[root@node1 ~]# vim /etc/issue
安装插件
[root@node1 ~]# yum -y install vim tree lrzsz
清除uuid
[root@node1 ~]# >/etc/udev/rules.d/70-persistent-ipoib.rules
标签:port 登录 tin root 文件 提示信息 network eth0 name
原文地址:http://www.cnblogs.com/wanglan/p/7399349.html