LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No DHCPOFFERS received (https://www.linuxquestions.org/questions/linux-newbie-8/no-dhcpoffers-received-4175527884/)

AlexBoter 12-10-2014 08:13 AM

No DHCPOFFERS received
 
Helo,

In order to solve the problem I tried as root to open /etc/sysconfig/network-scripts/ifcfg-eth0 and there to configure static IP as following:

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes

but the terminal couldn't complete the ifcfg-eth0 part.

How can I solve it?

pingu 12-10-2014 09:41 AM

Add
TYPE=Ethernet
You might also want to add a gateway

If that doesn't help, please post complete error message and log ouput.

AlexBoter 12-10-2014 12:07 PM

Thank u for reply.
The terminal doesn't complete "ifcfg-eth0", it completes until
/etc/sysconfig/network-scripts/
It doesn't have the option of "ifcfg-eth0", therefore i cannot reach the file in order to configure IP parameters.

markotitel 12-10-2014 12:46 PM

Which distro are you using?

AlexBoter 12-10-2014 01:41 PM

VMware@Workstation
Centos
10.0.3 build 1895310

10X

pingu 12-11-2014 02:51 AM

Ok, now I understand what you mean.
So what ifcfg-files do you have? ("ls /etc/sysconfig/network-scripts/ifcfg-*") You see, "eth0" is just a name and could be anything - although eth0 is probably the most common.

If there is no ifcfg-file at all there is some other problem, we'll look into it then. You could start with checking the file "/etc/udev/rules.d/70-persistent-net.rules"
Is this a vmware guest?

AlexBoter 12-11-2014 07:47 AM

Hi,

I managed to write "cat /etc/sysconfig/network-scripts/ifcfg-eth0" and got the following parameters:

DEVICE=eth0
HWADDR=00:0C:29:4B:FF:29
TYPE=Ethernet
UUID=...
ONBOOT=no
NM_CONTROLLED=yes
BOOTPOTO=dhcp

however when I (root) write the path "/etc/sysconfig/network-scripts/ifcfg-eth0" I get the message "Permission denied".

What should I do?

pingu 12-11-2014 08:06 AM

You are not very clear, I'm not sure what you're actually doing.
What do you mean with "write the path "/etc/sysconfig/network-scripts/ifcfg-eth0"?
Please post output of:
ls -l /etc/sysconfig/network-scripts/
cat /etc/udev/rules.d/70-persistent-net.rules

AlexBoter 12-11-2014 12:57 PM

No DHCPOFFERS received
 
Pingu,

Please find attched files with the information u asked.

Thanks

pingu 12-11-2014 01:01 PM

I can't see any files?
It's also better to just copy-paste the output directly into your post, makes it easier to follow the thread.

AlexBoter 12-11-2014 02:05 PM

results of ls -l /etc/sysconfig/network-scripts/

-rw-r--r--. 1 root root 136 Jun 22 06:40 ifcfg-eth0
-rw-r--r--. 1 root root 254 Oct 10 2013 ifcfg-lo
lrwxrwxrwx. 1 root root 20 Sep 7 17:00 ifdown -> ../../../sbin/ifdown
-rwxr-xr-x. 1 root root 627 Oct 10 2013 ifdown-bnep
-rwxr-xr-x. 1 root root 5430 Oct 10 2013 ifdown-eth
-rwxr-xr-x. 1 root root 781 Oct 10 2013 ifdown-ippp
-rwxr-xr-x. 1 root root 4168 Oct 10 2013 ifdown-ipv6
lrwxrwxrwx. 1 root root 11 Sep 7 17:00 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root 1481 Oct 10 2013 ifdown-post
-rwxr-xr-x. 1 root root 1064 Oct 10 2013 ifdown-ppp
-rwxr-xr-x. 1 root root 835 Oct 10 2013 ifdown-routes
-rwxr-xr-x. 1 root root 1465 Oct 10 2013 ifdown-sit
-rwxr-xr-x. 1 root root 1434 Oct 10 2013 ifdown-tunnel
lrwxrwxrwx. 1 root root 18 Sep 7 17:00 ifup -> ../../../sbin/ifup
-rwxr-xr-x. 1 root root 12444 Oct 10 2013 ifup-aliases
-rwxr-xr-x. 1 root root 859 Oct 10 2013 ifup-bnep
-rwxr-xr-x. 1 root root 10556 Oct 10 2013 ifup-eth
-rwxr-xr-x. 1 root root 11971 Oct 10 2013 ifup-ippp
-rwxr-xr-x. 1 root root 10490 Oct 10 2013 ifup-ipv6
lrwxrwxrwx. 1 root root 9 Sep 7 17:00 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root 727 Oct 10 2013 ifup-plip
-rwxr-xr-x. 1 root root 954 Oct 10 2013 ifup-plusb
-rwxr-xr-x. 1 root root 2364 Oct 10 2013 ifup-post
-rwxr-xr-x. 1 root root 4154 Oct 10 2013 ifup-ppp
-rwxr-xr-x. 1 root root 1925 Oct 10 2013 ifup-routes
-rwxr-xr-x. 1 root root 3289 Oct 10 2013 ifup-sit
-rwxr-xr-x. 1 root root 2488 Oct 10 2013 ifup-tunnel
-rwxr-xr-x. 1 root root 3770 Oct 10 2013 ifup-wireless
-rwxr-xr-x. 1 root root 4623 Oct 10 2013 init.ipv6-global
-rwxr-xr-x. 1 root root 1219 Sep 3 09:02 net.hotplug
-rw-r--r--. 1 root root 13449 Sep 3 09:02 network-functions
-rw-r--r--. 1 root root 29853 Oct 10 2013 network-functions-ipv6

results of cat /etc/udev/rules.d/70-persistent-net.rules

This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:4b:ff:29", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:4b:ff:33", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

pingu 12-11-2014 02:29 PM

According to your udev output you have 2 nic's, eth0 and eth1. It could also be that you replaced a nic, in some occasions "eth0" is not replaced but a new nic "eth1" is created.
One important thing is whether this is a vmware guest or not, that question is still unanswered? If it is, we might need to look at vmware's config for the guest.

You could try to copy ifcfg-eth0 to ifcfg-eth1, see if you can bring up eth1 then.

And again, what exactly do you mean by "write the path "/etc/sysconfig/network-scripts/ifcfg-eth0""?
The file exists and is writable by root. What exactly did you do?

AlexBoter 12-11-2014 03:12 PM

I mean that the output of "/etc/sysconfig/network-scripts/ifcfg-eth0" is:
bash: /etc/sysconfig/network-scripts/ifcfg-eth0: Permission denied.


About the guest (I am not sure I understand the term) issue - I am using virtualized machine and CentOS is installed on it.

The following command:

ps ax|grep vmware

returns the following output:
3907 pts/2 S+ 0:00 grep vmware

pingu 12-12-2014 01:14 AM

Ah I see! You don't execute that file, it's read by system.
What you do to bring up the interface is command (as root or using sudo) "ifup eth0".
Maybe it's already in state up (can be even without ip) then you bring it down first "ifdown eth0".

In the file /etc/sysconfig/network-scripts/ifcfg-eth0, you can delete the line "UUID=..". Also HWADDR is not necessarily needed, you already have set DEVICE=eth0. No problem keeping it though.
If eth0 doesn't work as it should, try copying ifcfg-eth0 to ifcfg-eth1, change DEVICE=eth1 and HWADDR=00:0C:29:4B:FF:33
Then try "ifup eth1"

AlexBoter 12-12-2014 11:52 AM

Hello,

After changing permission of ifcfg-eth0 file I managed to change the parameters as follows:

DEVICE=eth0
HWADDR=00:0C:29:4B:FF:29
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

In network-scripts directory was additional file named etho-lo, but I didn't find file of eth1, moreover the network-scripts directory doesn't permit to add/delete files.

Parameters of ifcfg-lo file:

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback


Thank u


All times are GMT -5. The time now is 01:39 AM.