I set up CentOS yet.
it's no network connection. eth0 is not device list.
I take a message network is unreachable
while ping 192.168.0.1
the screen shot of device list
How can I do reachable network?
I set up CentOS yet.
it's no network connection. eth0 is not device list.
I take a message network is unreachable
while ping 192.168.0.1
the screen shot of device list
How can I do reachable network?
Your Ethernet port is called enp2s0
, not eth0
. This naming system is called Predictable Network Interface Naming and details are available here.
Check the file /etc/sysconfig/network-scripts/ifcfg-enp2s0
, which should be similar to the following:
DEVICE='enp2s0'
TYPE=Ethernet
BOOTPROTO=none
ONBOOT='yes'
IPADDR=a.b.c.d
NETMASK=255.255.255.0
GATEWAY=a.b.c.1
NM_CONTROLLED='yes'
DNS1=8.8.4.4
DNS2=8.8.8.8
(a.b.c.d
is your IP address)
Or, if you're using DHCP:
DEVICE='enp2s0'
TYPE=Ethernet
BOOTPROTO=dhcp
ONBOOT='yes'
NM_CONTROLLED='yes'
Once you've checked/edited the file above, restart networking with:
systemctl restart network.service
Your ethernet device is enp2s0
. This follows the new predictable device naming scheme under linux. You have to replace all references to eth0 by enp2s0 or revert to the old naming scheme; all you need is described here. To quote from there:
You basically have four options:
- You disable the assignment of fixed names, so that the unpredictable kernel names are used again. For this, simply mask udev's rule file for the default policy: ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules (since v209: this file was called 80-net-name-slot.rules in release v197 through v208)
- You create your own manual naming scheme, for example by naming your interfaces "internet0", "dmz0" or "lan0". For that create your own udev rules file and set the NAME property for the devices. Make sure to order it before the default policy file, for example by naming it /etc/udev/rules.d/70-my-net-names.rules
- You alter the default policy file, for picking a different naming scheme, for example for naming all interface names after their MAC address by default: cp /usr/lib/udev/rules.d/80-net-setup-link.rules /etc/udev/rules.d/80-net-setup-link.rules, then edit the file there and change the lines as necessary.
- You pass the net.ifnames=0 on the kernel command line (since v199)
systemctl status network.service; failed to start lsb bring up/down networking
– SerefSEVEN Jul 31 '14 at 20:36journalctl -u network
. You should see the log messages related to the network service. Did you go for DHCP or static IP? – garethTheRed Jul 31 '14 at 20:45eth0
entry still in there somewhere. You should get rid of that. Also, you have theRNETLINK answers: File exists
message which usually means you have twoGATEWAY
entries in the network-script files. – garethTheRed Jul 31 '14 at 21:12