[SOLVED] Add a secondary network public IP

michaelj

Renowned Member
Jun 30, 2016
57
0
71
37
Hi Community,

I apologize if the subject has already been discussed but I have not found an answer to my case.

I would like to add a second public IP on my server.

Here is my current configuration:

auto lo
iface lo inet loopback

iface eno1 inet manual

iface eno2 inet manual

iface enp0s20f0u8u3c2 inet manual

auto vmbr0
iface vmbr0 inet static
address 51.x.x.x/24
gateway 51.x.x.254
bridge-ports eno1
bridge-stp off
bridge-fd 0
network 51.x.x.0

auto vmbr2
iface vmbr2 inet static
address 172.x.0.x/16
bridge-ports eno2
bridge-stp off
bridge-fd 0
post-up /sbin/route add -net 224.0.0.0/4 vmbr2
pre-down /sbin/route del -net 224.0.0.0/4 vmbr2

I would like to add this configuration, how can I do it?


address 5.135.x.x
netmask 255.255.255.224
gateway 5.135.x.x

Both IPs must be reachable at the same time.

Regards,

Michael.
 
Hi Dylan,

Thank you for your answer but i can't do what i want.

I would like to add a secondary IP to my interface vmbr0.

I tried using command line :

Bash:
ip addr add 5.135.xxx.xxx/27 dev vmbr0

route

Bash:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         51.210.xxx.254  0.0.0.0         UG    0      0        0 vmbr0
5.135.xxx.xxx    0.0.0.0         255.255.255.224 U     0      0        0 vmbr0
51.210.xxx.0    0.0.0.0         255.255.255.0   U     0      0        0 vmbr0
172.25.0.0      0.0.0.0         255.255.0.0     U     0      0        0 vmbr2
224.0.0.0       0.0.0.0         240.0.0.0       U     0      0        0 vmbr2

Using interfaces file :

Code:
auto vmbr0
iface vmbr0 inet static
        address 51.210.xxx.xxx/24
        gateway 51.210.xxx.254
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
        network 51.210.xxx.0

iface vmbr0 inet static
        address 5.135.xxx.xxx/27

I can't ping my second IP, even if i reboot the host.

Could you help me ?

Regards.
 
I found my problem, it was related to my provider.

I confirm that this configuration below works on proxmox 6 (vmbr2 not vmbr0) :

Bash:
iface vmbr2 inet static
        address 5.135.xxx.xxx/27