• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why is my static IP address not set to what I made it in the /etc/sysconfig/network-scripts/ifcfg-en

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have made the following changes to /network-scripts/ifcfg-enp0s3 file in order to try and get a static IP address (added ip i want ending in .49, added gateway, Prefix and Subnet mask (

1: https://i.stack.imgur.com/Qamcp.png image of file included)

But i get this error message when I attempt to restart network (image of error included) enter image description here


When I check Jornalctl -xe I get this (image included)


Possible solution i found: “If you are using NetworkManager there will be more items that you would need to configure like: GATEWAY, DOMAIN, DNS1, DNS2, etc. If you are not using NetworkManager, you will need to configure the gateway address in the /etc/sysconfig/network file, and the DNS resolvers (if required) in the /etc/resolv.conf file I added DNS="8/8/8/8".” But I do not know how to configure DNS, Domain etc.
 
Marshal
Posts: 4532
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems like you have a bit of a mess.

The title on the post mentions ifcfg-en, your config file show enp0s3 (ifcfg-enp0s3), and the messages from systemctl complain about ifcfg-rh and eth3 (ifcfg-eth3).

 
Saloon Keeper
Posts: 27865
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would have been a lot better if you had copied and pasted the actual text instead of posting screen shots. Screen shots are hard to read, eat up a lot of space on our server and don't appear for reference when we try to reply.

As I recall, you had determined that NetworkManager was in control of your system's networking. In that case I do not recommend manually working with the /etc/sysconfig/network-scripts directory. Use nm-tui or the desktop networking GUI (if available).

Please be aware that CentOS renames many network devices as part of system startup, so what you seen in the boot logs may not exactly match what the "ip address" command shows. You'll want to configure the "ip a" devices.

My own experience with restarting Red Hat networking as a whole, as opposed to simple device control has been disappointing. I generally have to reboot the entire system to get things working as expected.
 
Bartender
Posts: 217
7
Android Python Oracle Postgres Database Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Applying the information in https://www.baeldung.com/linux/set-static-ip-address should help.

Section 6 is about Redhat -based distributions and especially  "6.2. Create Interface Configuration File" contains a network interface example.
 
reply
    Bookmark Topic Watch Topic
  • New Topic