1

==== Question edited after the problem "solved", but the question remains clueless to me ====

Hosting provider's support staff solved the problem without giving explanation.

linux: how to set multiple (public) IP to one network interface? (For Ubuntu 22.04 / 14.04)
Adding IPs to netplan or /etc/network/interfaces make IP appear locally, but routing does not work.

What is the possible reason that routing failed?
What kind of network configuration (not the server) is needed for such kind of setup in linux to work?
How to troubleshoot such problems on linux?

Example with actual IP erased:

  1. Let default/primary IP subnet be 80.80.80.80/29.
  2. Let new IP subnet be 110.110.110.100/30. (1 usable - 110.110.110.102; 3 service addresses)
# primary IP config (14.04/interfaces; 22.04/netplan is similar and skipped)
auto eth1
iface eth1 inet static
        address 80.80.80.82
        netmask 255.255.255.248
        gateway 80.80.80.81
auto eth1:0
iface eth1:0 inet static
        address 80.80.80.83
        netmask 255.255.255.248
...
# Not working until hosting support did something
# auto eth1:5
# iface eth1:5 inet static
#        address 110.110.110.102
#        netmask 255.255.255.252
# ip route show
default via 80.80.80.81 dev eth1 
80.80.80.80/29 dev eth1  proto kernel  scope link  src 80.80.80.82 
172.16.0.0/12 via 172.16.xx.yy dev eth0 
# The only eth1 route entry is 1st line.

"ping -I 110.110.110.102 8.8.8.8" on the machine; or "ping 110.110.110.102" from other machine (in same data center) does not work, until hosting support does something. (support mentions vlan)


It seems that the hosting provider needs some setup but didn't do it.
The support staff did something (mentions setup a vlan), but does not bother full explanation, so I don't know what was wrong, or what is the correct way to troubleshoot or solve the problem.

Hopefully someone could explain how it is expected to work at linux and network.

5
  • Maybe see askubuntu.com/questions/585468/…
    – Tetsujin
    Commented Dec 31, 2022 at 19:55
  • @Tetsujin Unfortunately, not related. That question's two IPs are in the same subnet and will certainly work. Commented Dec 31, 2022 at 20:11
  • See also ostechnix.com/…
    – harrymc
    Commented Dec 31, 2022 at 20:32
  • What are you trying to do and why do you belueve your config is not working? (Requests you initiate from the server will, by default go through the first IP, but both IP addresses should answer if you are running services on them)
    – davidgo
    Commented Jan 1, 2023 at 7:15
  • @davidgo ping <dst> -I <new-IP> on the machine: fails; or ping <new-IP> on other machine: fails (same data center). Commented Jan 1, 2023 at 8:37

0

You must log in to answer this question.

Browse other questions tagged .