装好fedora22_X86_64并update后查看网卡名字
指令:
ifconfig[root@localhost ~]# ifconfig
输出:
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.29 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::223:aeff:fe9d:5ed3 prefixlen 64 scopeid 0x20<link>
ether 00:23:ae:9d:5e:d3 txqueuelen 1000 (Ethernet)
RX packets 1016319 bytes 1492404110 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 531401 bytes 36819119 (35.1 MiB)
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 8 bytes 800 (800.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 800 (800.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:ff:e7:48 txqueuelen 0 (Ethernet)
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 ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-enp2s0 ifcfg-eth0
[root@localhost network-scripts]# gedit ifcfg-eth0 &
在打开的文件中修改,标识出来的修改的内容
HWADDR="00:23:AE:9D:5E:D3"
DEVICE="eth0"
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="8bdf51aa-5496-412e-92c7-7f595d40b8fd"
ONBOOT="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
保存并关闭文件
指令
[root@localhost network-scripts]# gedit /etc/default/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=fedora/swap rd.lvm.lv=fedora/root rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
保存并关闭文件
指令
[root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg
输出
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.14-200.fc22.x86_64
Found initrd image: /boot/initramfs-4.4.14-200.fc22.x86_64.img
Found linux image: /boot/vmlinuz-4.0.4-301.fc22.x86_64
Found initrd image: /boot/initramfs-4.0.4-301.fc22.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d10b1989726d46b8ae5fac51b3e87df6
Found initrd image: /boot/initramfs-0-rescue-d10b1989726d46b8ae5fac51b3e87df6.img
重启机器查看网卡名字
指令:
[root@localhost ~]# ifconfig
输出:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.28 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::223:aeff:fe9d:5ed3 prefixlen 64 scopeid 0x20<link>
ether 00:23:ae:9d:5e:d3 txqueuelen 1000 (Ethernet)
RX packets 212 bytes 18721 (18.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 64 bytes 6413 (6.2 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 1 (Local Loopback)
RX packets 4 bytes 340 (340.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 340 (340.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:ff:e7:48 txqueuelen 1000 (Ethernet)
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
修改完毕。