0

I'm adding a secondary IP to my CentOS 8 server running NetworkManager. I would previously have done this with ifcfg-style configuration files, but I'm trying to embrace the future and the direction RHEL/CentOS is setting. Unfortunately, this isn't going the way I expected.

What I was expecting, was a new ethernet interface. The reason for wanting this, is that it allows me to bind different services to different IPs, possibly on the same ports. This is nothing new, and it "just worked" with files like ifcfg-eth0:1 in previous versions of CentOS. Now, my ifcfg-eth0:1 alias file is either being completely ignored, or results in an additional IP being added to the primary interface. No method has so far created an additional network interface.

My question now is this: Is this actually possible in CentOS8 without reverting to network-scripts? Is the concept of binding a service to a specific network interface a thing of the past??

Saustrup
  • 1,183
  • 1
  • 8
  • 12

2 Answers2

2

There isn't a new network interface. There's no such thing as a virtual network interface alias eth0:1 any more, not for well over a decade. It is just a secondary address on eth0, and it also was just a secondary address on eth0 when you were using it in previous versions of CentOS.

You didn't mention anything about why you thought you actually had distinct network interfaces (again, you didn't) or what you are trying to accomplish, so it's impossible to advise you on what to do next.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • You're absolutely right - terrible question. Spotting an alias interface while running ifconfig was my go-to proof of success, and obviously this is only true for our ancient CentOS 5.5 server. Looking at our slightly less outdated CentOS 6.1 server, I see in the output of ip addr that secondary IPs are actually associated with the primary interface. I guess times change! :D – Saustrup Sep 08 '20 at 07:17
1

A service is bound to an IP address, not to an interface. Therefore, nothing changes when you update to newer scripts. If you have some issue, please describe the actual issue in the question and you can get help to resolve the issue.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • Sorry, frustration got the best of me. I seemed to remember that you could specify an interface when configuring how a service should bind, but obviously an IP is the way to go. Thanks for correcting me. – Saustrup Sep 08 '20 at 07:19