1

I do not understand why, because I have multiple Debian 9 servers and I have this problem only one one server:

I do not have /etc/network/interfaces files.

I need to host multiple ip addresses on this server.

I have read some documentations and I have added ip address into this file:

/etc/systemd/network/50-default.network

I have added a line with Address=x.x.x.x for each IP in [Network] section.

Everything works but I do not see all my IP in ifconfig... I only see first IP.

I have notice I have a eno3 interface.

On my other servers, I can see eth0, eth0:0, eth0:1

Thanks

Rot-man
  • 327
  • 2
  • 9
Bob5421
  • 319
  • 3
  • 8
  • 16
  • try ip addr show, not ifconfig. the "virtual" ips might not be visible with ifconfig anymore if you configure them via systemd – Dennis Nolte Jun 28 '18 at 13:03
  • 1
    /etc/network/interface is if i remember just a fallback service when you use systemd. we had this issue as well, but we disabled the fallback service so no network/interfaces at all. – Dennis Nolte Jun 28 '18 at 13:05

1 Answers1

-1

Do this:

echo '#!/bin/bash' > /etc/init.d/ipaliases
echo 'ifconfig eno3 1.2.3.4' >> /etc/init.d/ipaliases
echo 'ifconfig eno3 4.5.6.7' >> /etc/init.d/ipaliases
chmod 755 /etc/init.d/ipaliases
ln -s /etc/init.d/ipaliases /etc/rc2.d/S01ipaliases

Then reboot you machine.

Jonas Bjork
  • 386
  • 1
  • 4
  • Replace 1.2.3.4 etc with your IP addresses. – Jonas Bjork Jun 28 '18 at 12:32
  • This sets the ip additionally to the systemd way, which might result in problems. Setting an ip twice to the same interface usually overwrites it. additionally you forgot the subnetmask. additionally please use the private IPs for examples like that (RFC1918 f.e.) creating an init script outside systemd when using systemd as INIT is not that a good idea as well in my opinion. you dont need to reboot to reinitalise network interface values as well. – Dennis Nolte Jun 28 '18 at 13:10
  • @Dennis Nolte You don't need a netmask when dealing with ip aliases - they are the same and they inherit the netmask from the primary address. Regarding the init stuff - no it won't cause any problems. You don't need to reboot but it's a good way of confirming that it works on-boot. – Jonas Bjork Jun 28 '18 at 13:13