Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Proxmox KVM default gateway?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Proxmox KVM default gateway?

So I bought a dedicated server with a couple extra ipv4 addresses. During the checkout I was given the option of getting a /29 or just buying them separate. I went with buying 4 additional IPs separately because it was cheaper.

I have proxmox VE installed on the server and I have no issue using OpenVZ since it doesn't need a gateway when you create the container. But with KVM I need to specify a default gateway.

The server is on a /26 network with each of my additional IP addresses on a /32 leaving each of them on their own network. My question being what would be the default gateway for the additional IPs? If there even is one.

Now I'm no stranger to both virtualization and networking but this has me stumped.

Comments

  • marcmmarcm Member

    If you have multiple IPs on different subnets just pick one and use it as your main IP and use the gateway address of that IP as the default gateway. It's that simple.

  • @marcm said:
    If you have multiple IPs on different subnets just pick one and use it as your main IP and use the gateway address of that IP as the default gateway. It's that simple.

    Main IP for the host or for the VM?

  • marcmmarcm Member

    CFarence said: Main IP for the host or for the VM?

    Well, think of it this way: as a general rule this is how it works for everyone. The host node has an IP address and the gateway of that address is the default gateway for the node. For the VMs you will use the default gateway of the main IP that you're using for that VM. In reality all IPs will be routed through the default gateway of the host node, but that will be transparent to the VM. I don't know if it does or does not make sense to you, but it's really that simple. Don't think about the host node when you configure the VM, just think of the VM as another server.

  • CFarenceCFarence Member
    edited March 2014

    @marcm said:

    I get what your saying, I'm taking computer networking courses through my local college. I tried using the default gateway the host uses but the VM just says host not reachable.

  • marcmmarcm Member

    CFarence said: I tried using the default gateway the host uses but the VM just says host not reachable.

    That's exactly my point, don't. Use the gateway for the address that your VM is using. Subnets can only be routed via their respective gateway.

    Using a simple example here with private IPs:

    If host is 192.168.10.5 and gateway is 192.168.10.1 then use this as the default gateway for the host node.

    If VM is 192.168.11.21 and gateway is 192.168.11.1 then this is the default gateway for the VM, not the host's default gateway. The Linux kernel will ensure that it gets routed properly.

  • CFarence said: I tried using the default gateway the host uses but the VM just says host not reachable.

    ip route add $defaultGateway dev eth0

    ip route add default via $defaultGateway

    Thanked by 1marrco
  • I tried Proxmox once. Created a few KVM based vm's but networking didn't work. You have to manually install the kvm machines and apply custom network settings instead of using auto detection to get it working.

    It might be possible to automate this process but I couldn't figure it out.

  • marcmmarcm Member
    edited March 2014

    Full disclosure, I don't work with Proxmox. I was just trying to explain the theory.

    @Rallias if you like pizza, get some Dr. Oetker Ristorante "Peperoni & Pesto", put it in your oven at 425 degrees for 15 minutes, and enjoy :D

    @CFarence I would guess that it's the Cisco CCNA course that you're taking. How far into it are you? Which chapter?

  • marcm said: Full disclosure, I don't work with Proxmox. I was just trying to explain the theory.

    I just don't know if KVM will work since my additional IPs sub netted into a /32 leaving only 1 address. It can't even talk to my other IPs because they are in a /32 also with no gateway.

  • marcm said: I would guess that it's the Cisco CCNA course that you're taking. How far into it are you? Which chapter?

    It's not the Cisco right now I'm taking a standard computer networking class

  • marcmmarcm Member

    CFarence said: It's not the Cisco right now I'm taking a standard computer networking class

    If you want to experiment with networking and subnetting the download Cisco Packet Tracer version 6.

    Also, /32 means single IP. If those individual IPs are on different subnets then they will all have different gateway addresses. I'm not sure how anyone could expect you to properly configure them without providing you with that information.

    Thanked by 1Zen
  • They told me its a /32 and I immediately realized it is a single address. And that where my original problem came into play. How would I even use those for VMs when there is no default gateway, it couldn't even have a gateway on that network. I'm thinking I should have ordered a /29 instead of the additional. I have never rented a dedicated before, I have only used in house virtualization behind a NAT and single VPSes from places like RamNode.

  • marcmmarcm Member

    Are those individual addresses on the same network?

  • Here is how I got this to work on a host running Proxmox with a /32 assigned to me that is not on the same network of the host node that I wanted to use on a KVM:

    • Create a bridge on the host node (prefixing the bridge by 'vm' allows this bridge to be selected in the Proxmox UI when creating a VM):

    auto vmbr1 iface vmbr1 inet static address $IP.OF.THE.HOSTNODE netmask $NETMASK.OF.THE.HOSTNODE bridge_ports none bridge_stp off bridge_fd 0 up ip route add $ADDITIONAL.IP/32 dev vmbr1 down ip route del $ADDIOTIONAL.IP/32 dev vmbr1

    Activate the bridge (ifup vmbr1), create the VM, in the network config of the VM connect it to this bridge.

    • Network configuration of the VM (Debian config, modify to the distro/OS you're using)

    iface eth0 inet static address $ADDITIONAL.IP netmask 255.255.255.255 gateway $IP.OF.THE.HOSTNODE pointopoint $IP.OF.THE.HOSTNODE

    The route commands in the host bridge tell the kernel to send traffic destined for the additional address on to the bridge, the pointopoint designation directly connects the VM to the hostnode ip for it's gateway, so they don't have to be on the same network. YMMV, but this works for me.

    Thanked by 3CFarence marrco lynda
  • marcm said: if you like pizza, get some Dr. Oetker Ristorante "Peperoni & Pesto", put it in your oven at 425 degrees for 15 minutes, and enjoy :D

    I might do so. I usually make my own, using a coarse-ground whole-wheat base, tomato paste mixed with thickened chicken broth for the sauce, mozzarella and cheddar cheese, and glorious amounts of andouille sausage.

  • @CFarence - this is easily done:

    In the VMs you'll need to set the default routing like this:

    route add X.X.X.X/32 dev eth0
    route add default gw X.X.X.X

    where X.X.X.X is your servers primary IP

    Then back on the node itself:

    route add Z.Z.Z.Z/32 dev vmbr0

    for each of the /32 IPs you have been assigned.

    If you want to PM me with details I can help you sort this in seconds.

  • Did you check drivers, some times proxmox needs Paravirtualisation drivers

  • @UltranetUSA - its not drivers. Its because he is using /32's. Needs a bit of manual work

  • @dabtech Its acting really weird. Ubuntu is saying it doesn't have an eth0. In the virtual machine's config I have a network device added with the new bridge I made but it doesn't show up in the VM. I tried it with a windows VM and just set the IP and gateway manually and everything worked like a charm. Its juts when I use a linux VM.

  • @CFarence That does not seem right there is no eth0 in your Ubuntu vm. What does ifconfig -a give you?

  • @dabtech said:
    CFarence That does not seem right there is no eth0 in your Ubuntu vm. What does ifconfig -a give you?

    Sorry for the late response. Didn't really have much time to play with it. I finally got it to work, I reinstalled ubuntu completely. I must have messed something up somewhere, because nothing I tried worked. My interfaces file looked correct, so I'm not actually sure what happened.

    Thanks for all your help, it works perfectly now :)

  • I've tried both approaches but none of them seem to work with my additional IP address. I dropped a PM to Mark with the details.

  • Dear all, I think I have the same problem with CFarance. I am installing Proxmo 3.3 and I believe everything works fine. Now I am creating a Windows 7 VM and try to ping out and seems every thing is unreachable from this VM. I am not so sure too what config I need to apply on the server side and on the VM Windows side. I might not as smart on this but any assistance will be very much appreciated.

    Thank you

  • FalzoFalzo Member
    edited November 2014

    normally your provider should tell which IP to use as gateway...
    there are a lot of howto's per provider, so might help if you're telling where you got your dedi from ;-)

    http://help.ovh.co.uk/Proxmox or http://wiki.hetzner.de/index.php/Proxmox_VE/en

    it's easier if you can setup bridged mode, but you need the possibility to assign seperate MAC-address for the given IPs... than you won't need to setup anything special for routing on your host, just tell proxmox the MAC-address

  • I have a physical server (supporting VE, 4 ethernets, 16 RAM and 2T hard drive) which I install proxmox 3.3(from a downloaded ISO) on, and its working well as I can access the web admin page and add & configure VMs on it. This server is in a /24 network. I need only two VMs on this physical server, i.e. Windows 7 and Ubuntu Server and I have done that and they are installing and work perfectly.I use KVM bridge when I create these two VMs as I need their IPs to be on the same /24 network. I need these VMs to be accessible and be seen from my LAN clients and vice versa which is not working at the moment. If LAN access is working, Internet access is required to both VMs too. I have two Internet providers giving only 1 ipv4 public IP each. I want to use only one from these public IPs.
    Currently, I am trying to configure the Windows VM first and it seems that it's not accessible from and to the LAN.

    If I do not provide enough information required I will be willing to explain more the current status I am in.

    Well as I have mentioned, I am new to configuring proxmox KVM bridge in a LAN environment so anyone's assistance will be very much appreciated.

    So it must be easier if one could help with steps on what I need to do first and so on until I get to the VM network configuration working.

    Thank you

  • @nerovita - who is the service provider?

  • The Service provider is our local ISP here. Telecom Services Kiribati Limited.... TSKL

    thanks

  • @nerovita - Ok :) You need to understand from them how they have setup your additional IPs. Whether they are looking for you to bridge/route traffic specifically.

  • Thanks Mark,

    I'll ask them about that..... and surely come back for more request that I have on this setup...

    regards

  • elgselgs Member

    The gw of the vms is the gw of your dedicated server.

Sign In or Register to comment.