Multiple Public IP help plz!

allow-hotplug eth0
iface eth0 inet static
address x.x.7.145
netmask 255.255.255.248
network x.x.7.144
broadcast x.x.7.151
gateway x.x.7.144
dns-nameservers 8.8.8.8 8.8.4.4

network line seem bad. (can't be the same than gateway).

can you try

Code:
[COLOR=#333333]allow-hotplug eth0[/COLOR]
[COLOR=#333333]iface eth0 inet static[/COLOR]
[COLOR=#333333]address x.x.7.145[/COLOR]
[COLOR=#333333]netmask 255.255.255.248[/COLOR]
[COLOR=#333333]gateway x.x.7.144[/COLOR]
[COLOR=#333333]dns-nameservers 8.8.8.8 8.8.4.4[/COLOR]


Just to be sure, what are the infos you have from your hosting provider ?


If the network is x.x.7.144/255.255.255.248 , the usable ip address are
x.x.7.145 - > x.x.7.150

x.x.7.144 is the network address and can't be used.

So maybe you can try

x.x.7.145 for proxmox host, and x.x.7.146 for your vm.
 
Last edited:
I don't see any reason with you can't ping host ping x.x.7.144 from guest ping x.x.7.145.
They are on the same vmbr0, so on the same virtual bridge.

If the network, broadcast,netmask are the same, they should ping together.




 
I tried the config in the above link, same story, within the vm, cant ping gateway. i swear its got to be routing, is it iptables2 in proxmox?

from the above test, i have eth0, vmbr0, vmbr1 (setup at proxmox gui).
then at proxmox vm gui i have venet with x.x.7.145.
this produces same result as the above (by that i mean putting primary ip on eth0, and secondary on vmbr0)

but maybe my routing is wrong if i follow that link, this is what i have tried:
root@proxmox:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback


auto vmbr0
iface vmbr0 inet static
address x.x.164.207
netmask 255.255.255.224
gateway x.x.164.193
bridge_ports eth0
bridge_stp off
bridge_fd 0


auto vmbr1
iface vmbr1 inet static
address x.x.7.144
netmask 255.255.255.248
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 'x.x.7.0/29' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 'x.x.7.0/29' -o vmbr0 -j MASQUERADE
 
I tried the config in the above link, same story, within the vm, cant ping gateway. i swear its got to be routing, is it iptables2 in proxmox?

from the above test, i have eth0, vmbr0, vmbr1 (setup at proxmox gui).
then at proxmox vm gui i have venet with x.x.7.145.
this produces same result as the above (by that i mean putting primary ip on eth0, and secondary on vmbr0)

but maybe my routing is wrong if i follow that link, this is what i have tried:
root@proxmox:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback


auto vmbr0
iface vmbr0 inet static
address x.x.164.207
netmask 255.255.255.224
gateway x.x.164.193
bridge_ports eth0
bridge_stp off
bridge_fd 0


auto vmbr1
iface vmbr1 inet static
address x.x.7.144
netmask 255.255.255.248
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 'x.x.7.0/29' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 'x.x.7.0/29' -o vmbr0 -j MASQUERADE


I don't known how this setup work.
If you have venet, it's because your guest network card is in nat mode, and not bridge.
(venet is a virtual network in kvm, this is why you need these masquerade iptables lines.


Now, with my setup, it's just a simple routing.
So proxmox route the packets from eth0 to vmbr0
They are no reason that you can't ping proxmox host ip of vmbr0 , from the guest network card on vmbr0 too. (It's not related to routing)
Also, you don't have venet interface in this setup.
 
OK! Finally got it working, silly me made a typo, in the above in the iptables line, it should have been x.x.7.144 for both lines, now i get external.

But i guess my last question, in my proxmox network gui, it's now set like this:
name: eth0
active: yes
autostart: no
ports/slaves:
ip address:
subnet mask:
gateway:

name: vmbr0
active: yes
autostart: yes
ports/slaves: eth0
ip address: x.x.164.207
subnet mask: 255.255.255.224
gateway: x.x.164.193

name: vmbr1
active: yes
autostart: yes
ports/slaves:
ip address: x.x.7.144
subnet mask: 255.255.255.248
gateway:


then i edited /etc/network/interfaces, adding the 2 iptable lines as above.
in the proxmox vm gui, added venet with x.x.7.145

everything works, but, is there better way to arrange that, like having x.x.164.207 on eth0 like i had it before? is there any benefit to having it one way or the other? to me, it seems vmbr0 is bridged to eth0, and vmbr1 is bridged to vmbr0......

just a last bit of advice on that would be great.


btw: this is with an openvz template, not kvm.
 
OK! Finally got it working, silly me made a typo, in the above in the iptables line, it should have been x.x.7.144 for both lines, now i get external.

But i guess my last question, in my proxmox network gui, it's now set like this:
name: eth0
active: yes
autostart: no
ports/slaves:
ip address:
subnet mask:
gateway:

name: vmbr0
active: yes
autostart: yes
ports/slaves: eth0
ip address: x.x.164.207
subnet mask: 255.255.255.224
gateway: x.x.164.193

name: vmbr1
active: yes
autostart: yes
ports/slaves:
ip address: x.x.7.144
subnet mask: 255.255.255.248
gateway:


then i edited /etc/network/interfaces, adding the 2 iptable lines as above.
in the proxmox vm gui, added venet with x.x.7.145

everything works, but, is there better way to arrange that, like having x.x.164.207 on eth0 like i had it before? is there any benefit to having it one way or the other? to me, it seems vmbr0 is bridged to eth0, and vmbr1 is bridged to vmbr0......

just a last bit of advice on that would be great.


btw: this is with an openvz template, not kvm.

Ok, I think that for openvz it's ok. (I think my setup should work with kvm but not openvz)

"everything works, but, is there better way to arrange that, like having x.x.164.207 on eth0 like i had it before? is there any benefit to having it one way or the other?"

>>everything works, but, is there better way to arrange that, like having x.x.164.207 on eth0 like i had it before? is there any benefit to having it one way or the other?
No you can keep like that. It's more near the default proxmox setup, with host ip on vmbr0.

>>"it seems vmbr0 is bridged to eth0, and vmbr1 is bridged to vmbr0"
No, eth0 is bridged to vmbr0. vmbr1 is standalone. But the host route the traffic between both ip.


Can you post your /etc/network/interfaces ? and also vmconfig /etc/pve/qemu-server/vmid.conf && vm network config too. I'll update the wiki !
 
Hmmm, so maybe not all the way there yet. When I do a traceroute, shows x.x.164.207 as first hop, and also can't connect to those secondary IPs (from outside).
So from within a vm, I can hit the internet, but can't seem to get in (I installed request tracker from the templates) - updated the IP to x.x.7.148.

So, I guess I have it working, but in NAT (iptables gave it away) and not routed mode. Ah getting closer...


Right now my /etc/network/interfaces of proxmox looks like this:

root@proxmox:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback


auto eth0
iface eth0 inet static
address x.x.164.207
netmask 255.255.255.224
gateway x.x.164.193


auto vmbr0
iface vmbr0 inet static
address x.x.7.144
netmask 255.255.255.248
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 'x.x.7.144/29' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 'x.x.7.144/29' -o eth0 -j MASQUERADE
 
Hmmm, so maybe not all the way there yet. When I do a traceroute, shows x.x.164.207 as first hop, and also can't connect to those secondary IPs (from outside).
So from within a vm, I can hit the internet, but can't seem to get in (I installed request tracker from the templates) - updated the IP to x.x.7.148.

So, I guess I have it working, but in NAT (iptables gave it away) and not routed mode. Ah getting closer...


Right now my /etc/network/interfaces of proxmox looks like this:

root@proxmox:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback


auto eth0
iface eth0 inet static
address x.x.164.207
netmask 255.255.255.224
gateway x.x.164.193


auto vmbr0
iface vmbr0 inet static
address x.x.7.144
netmask 255.255.255.248
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 'x.x.7.144/29' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 'x.x.7.144/29' -o eth0 -j MASQUERADE

Yes, I think your are natted.
To be sure, you can try to go to http://www.whatismyip.com/ , from your vm, and see which ip is used. If you see the ip host, your are natted.

I'll try to build a lab tomorrow to try to route with bridge vmbr0.
 
Hi,
I have read the openvz doc a little more,

If you use venet network interface for your openvz container. (ip configured in proxmox), you don't need to create a vmbr0 with x.x.7.144 gateway.

with venet the guest ip is "virtually" on the host, so routing should be possible between eth0 and venet.


This simple config should work:

Code:
[COLOR=#333333][I]auto lo[/I][/COLOR]
[COLOR=#333333][I]iface lo inet loopback[/I][/COLOR]


[COLOR=#333333][I]auto eth0[/I][/COLOR]
[COLOR=#333333][I]iface eth0 inet static[/I][/COLOR]
[COLOR=#333333][I]address x.x.164.207[/I][/COLOR]
[COLOR=#333333][I]netmask 255.255.255.224[/I][/COLOR]
[COLOR=#333333][I]gateway x.x.164.193[/I][/COLOR]
[COLOR=#333333][I]post-up echo 1 > /proc/sys/net/ipv4/ip_forward[/I][/COLOR]


also, look at
/etc/vz/vz.conf in your host, and enable:

VE_ROUTE_SRC_DEV="eth0"
 
Last edited:
sigh, that didn't work either.
I'm still looking at these and trying to understand how to change it to work with proxmox.
 
stupid datacenter. just talked to them again, ok so all IP have same mac as primary for starters.
secondly, i have 8 IP
x.x.7.144 - x.x.7.151
they say if using 255.255.255.248 only 6 are usable, but if i use 255.255.255.255 8 are usable. the more the better, does that make sense?
 
Hi, are you sure that x.x.7.144 is correctly routed (in the internet routeurs) through x.x.164.207 ?

Can you do a

#traceroute x.x.7.144

?

And see if it's hanging on x.x.164.207 ?

since my last post, tried this now using vmbr0 on x.x.7.145, running the following:
root@proxmox:~# traceroute 174.142.7.144
traceroute to 174.142.7.144 (174.142.7.144), 30 hops max, 60 byte packets
connect: Permission denied

if i try doing same on x.x.7.151, same thing - my DC is confusing me now?!? So what is real usable, 6 or 8?
 
stupid datacenter. just talked to them again, ok so all IP have same mac as primary for starters.
secondly, i have 8 IP
x.x.7.144 - x.x.7.151
they say if using 255.255.255.248 only 6 are usable, but if i use 255.255.255.255 8 are usable. the more the better, does that make sense?

Like I said you before,you have 8 ips but:
x.x.7.144 : network adress
x.x.7.145 -> 150 : 6 usables hosts
x.x.7.151 : broadcast address

and
255.255.255.255 netmask is not 8 ip usables, it's only 1 !

http://www.subnet-calculator.com/


 
since my last post, tried this now using vmbr0 on x.x.7.145, running the following:
root@proxmox:~# traceroute 174.142.7.144
traceroute to 174.142.7.144 (174.142.7.144), 30 hops max, 60 byte packets
connect: Permission denied

if i try doing same on x.x.7.151, same thing - my DC is confusing me now?!? So what is real usable, 6 or 8?

try to use x.x.7.145 on your host, and x.x.7.146 in your guest vm.

(don't use
x.x.7.144 or x.x.7.151)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!