1.查看IP地址linux
[root@localhost ~]# 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: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:20:53:b3 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.102/24 brd 192.168.1.255 scope global dynamic eno16777736
valid_lft 6568sec preferred_lft 6568sec
inet6 fe80::20c:29ff:fe20:53b3/64 scope link
valid_lft forever preferred_lft forever
3: eno33554976: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:20:53:bd brd ff:ff:ff:ff:ff:ff
inet 192.168.1.113/24 brd 192.168.1.255 scope global dynamic eno33554976
valid_lft 6569sec preferred_lft 6569sec
inet6 fe80::20c:29ff:fe20:53bd/64 scope link
valid_lft forever preferred_lft foreverios
2.修改grub文件,在該文件中添加紅色字體的一部分vim
[root@localhost ~]# vim /etc/sysconfig/grub服務器
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=VG00/swap vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=us rd.lvm.lv=VG00/root rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"ide
3. 構建新的img文件oop
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux p_w_picpath: /boot/vmlinuz-3.10.0-229.7.2.el7.x86_64
Found initrd p_w_picpath: /boot/initramfs-3.10.0-229.7.2.el7.x86_64.img
Found linux p_w_picpath: /boot/vmlinuz-3.10.0-229.4.2.el7.x86_64
Found initrd p_w_picpath: /boot/initramfs-3.10.0-229.4.2.el7.x86_64.img
Found linux p_w_picpath: /boot/vmlinuz-3.10.0-229.1.2.el7.x86_64
Found initrd p_w_picpath: /boot/initramfs-3.10.0-229.1.2.el7.x86_64.img
Found linux p_w_picpath: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd p_w_picpath: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux p_w_picpath: /boot/vmlinuz-3.10.0-123.13.2.el7.x86_64
Found initrd p_w_picpath: /boot/initramfs-3.10.0-123.13.2.el7.x86_64.img
Found linux p_w_picpath: /boot/vmlinuz-0-rescue-f16a3c5e4d1949dd87cf7fdc31231925
Found initrd p_w_picpath: /boot/initramfs-0-rescue-f16a3c5e4d1949dd87cf7fdc31231925.img
done字體
4.從新啓動服務器ui
[root@localhost ~]# rebootspa
5.從新查看服務器的IP地址ip
[root@localhost ~]# ip a1: 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 forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:20:53:b3 brd ff:ff:ff:ff:ff:ff inet 192.168.1.102/24 brd 192.168.1.255 scope global dynamic eth0 valid_lft 7150sec preferred_lft 7150sec inet6 fe80::20c:29ff:fe20:53b3/64 scope link valid_lft forever preferred_lft forever3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:20:53:bd brd ff:ff:ff:ff:ff:ff inet 192.168.1.113/24 brd 192.168.1.255 scope global dynamic eth1 valid_lft 7150sec preferred_lft 7150sec inet6 fe80::20c:29ff:fe20:53bd/64 scope link valid_lft forever preferred_lft forever