2

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?

Braiam
  • 35,991

3 Answers3

3

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
garethTheRed
  • 33,957
  • I did what you typed. job for network.service failed. see "systemctl status network.service"

    systemctl status network.service; failed to start lsb bring up/down networking

    – SerefSEVEN Jul 31 '14 at 20:36
  • Type journalctl -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:45
  • I did for static IP. log message screen shot www.seven.gen.tr/images/IMAG0292.jpg – SerefSEVEN Jul 31 '14 at 20:53
  • You've got an eth0 entry still in there somewhere. You should get rid of that. Also, you have the RNETLINK answers: File exists message which usually means you have two GATEWAY entries in the network-script files. – garethTheRed Jul 31 '14 at 21:12
  • Ok I try again it after setup centos again. Thank you for your help. – SerefSEVEN Jul 31 '14 at 21:31
0

you have to use enp2s0, you do not have a device called eth0.

dhcpcd enp2s0
switch87
  • 926
0

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:

  1. 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)
  2. 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
  3. 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.
  4. You pass the net.ifnames=0 on the kernel command line (since v199)
countermode
  • 7,533
  • 5
  • 31
  • 58