[HELP] dhcp to static never worked for me

uberwebguruuberwebguru Posts: 29Member ■□□□□□□□□□
I have tried it all...matter of fact i almost know all the links and videos on changing dhcp to static IP and yet it never worked for me

Basically when i change the dhcp to ststic IP then no ping and nothing works..cannot access websites or anything...but yet i see the new static IP from the ifconfig command but no way to access anything

I edit the eth0 file...edit the resolv.conf file and the network file and everything basically i am supposed to do and yet it never worked.


Please help..please!!!

Comments

  • hiddenknight821hiddenknight821 Posts: 1,209Member ■■■■■□□□□□
    Are you sure you are doing it properly? When I edit the ifcfg-ethX script files directly in /etc/sysconfig/network-scripts/ directory, I was able to set it as DHCP client or use the static IP without a problem.

    You may need to set BOOTPROTO to none. You are required to have at least IPADDR, NETMASK, and GATEWAY option to make static IP works. You'd need to restart the network service by issuing `/etc/init.d/network restart`.

    You can't access the website with this script file configured alone. You'd also have to change the /etc/resolv.conf file. Perhaps you didn't point to the correct name servers, but make sure you configured it correctly.

    If you are still having problems, then I don't know how or why it became problematic in the first place. You might want to test on your clean RHEL instance and see if the problem is still there.
  • uberwebguruuberwebguru Posts: 29Member ■□□□□□□□□□
    Are you sure you are doing it properly? When I edit the ifcfg-ethX script files directly in /etc/sysconfig/network-scripts/ directory, I was able to set it as DHCP client or use the static IP without a problem.

    You may need to set BOOTPROTO to none. You are required to have at least IPADDR, NETMASK, and GATEWAY option to make static IP works. You'd need to restart the network service by issuing `/etc/init.d/network restart`.

    You can't access the website with this script file configured alone. You'd also have to change the /etc/resolv.conf file. Perhaps you didn't point to the correct name servers, but make sure you configured it correctly.

    If you are still having problems, then I don't know how or why it became problematic in the first place. You might want to test on your clean RHEL instance and see if the problem is still there.

    the /etc/resolv.conf changes disappears when i have networkmanager ON from ethx file...and when i put networkmanager OFF then no network at all whatsoever and the thing i see the config online having this as OFF...have no idea how they got it to work because i don't know how one can be connected without networkmanager ON

    anyways...yes i have done all of that and restarted network and i do get the new static IP...everything looking like it should work but then i cannot ping or browse internet with a browser
  • higherhohigherho Posts: 882Member
    reboot the box? Sometimes i took notice when you type in iproute that I had conflicting gateways and my traffic would go no where. Of course doing a network restart should clear this.
  • UnixGuyUnixGuy SABSA, GCFA, GPEN, CISM, RHCE, Security+, Server+, CCNA Posts: 3,946Mod Mod
    is it RHEL6 ? I remember I ran into a problem with RHEL 6 where the changes had to be done from the GUI. Did you try to double click on the network icon and change the setting from the GUI ?
    Goal: MBA, March 2021
  • onesaintonesaint Posts: 801Member
    Network manager needs to be disabled and turned off on all runlevels with chkconfig. Then the nic can be configured manually. Manual configuration changes are overwritten by network manager whenever networking is restarted. Include the basic configuration in ifcfg-ethX. Try "man ifcfg" for config options.
    Work in progress: picking up Postgres, elastisearch, redis, Cloudera, & AWS.
    Next up: eventually the RHCE and to start blogging again.

    Control Protocol; my blog of exam notes and IT randomness
Sign In or Register to comment.