How to assign an IP to new KVM Linux machine?

postcd

Member
Sep 16, 2013
40
0
6
Hello, i installed Proxmox and created new KVM virtual machine with Linux on it. Please how to achieve that VPS has its own dedicated IP i just bought from datacenter? I found there is "Network" tab in Proxmox, do i need to setup anything there? Thank you
 
You assign it from within the VM or you will need a dhcp server running to hand out IP addresses
 
Would welcome some step by step instruction/link to tutorial. Prefer to setup things from host server, not from guest server.
 
Then you are out of luck unless you run a DHCP server on your network.

for public addressable IPs, you cannot assign them via the host. you need to manually configure your IP in your GUEST
 
I have an server in remote datacenter, not sure if there is DHCP. > "you need to manually configure your IP in your GUEST " how to do this exactly, any tutorial please.
 
Create VM and use the vmbr that connects to the ETH device.
Boot VM.
From within the VM, you configure your IP address information. This is entirely dependent on what OS it is running. How would you configure a physical box sitting in front of you?

As far as the dhcp server goes, unless you configured and set one up, there isn't one.
 
thx, i cant find how to setup networking on KVM Linux (rhel 6.3) VPS ping hostserverip end up 100% packet loss ping google.com is unknown host tried many combinations in /etc/sysconfig/network-scripts/ifcfg-lo , setting up route "route add default gw *", please is there any foolproof tutorial on how to setup that KVM guest networking? there is network configuration (IPs) in case anyone want to take a look: http://pastebin.com/Cbkgm7Wr
 
Stop thinking about this being KVM.

Find ANY tutorial on manually configuring IP address on centos/red hat. It will work. I don't really know why you would mess with lo device since that's loopback.

Did you configure your name server in the guest?

Did you try pinging Google by IP? And not hostname?

These are basic networking things.

Are you sure your qualified to be running this server?


Since you've already given us your IP information, go ahead and send me your root password, and your email address and I will bill you for my time to fix it.
 
Thank You, i cant afford Admin, so i assume there is no universal tutorial which can guide one to setup KVM VPS networking. I read several tutorials like this one, but no luck after network service restart ping 8.8.8.8 100% loss
 
Thank You, i cant afford Admin, so i assume there is no universal tutorial which can guide one to setup KVM VPS networking. I read several tutorials like this one, but no luck after network service restart ping 8.8.8.8 100% loss
This has nothing to do with it being KVM VPS. Stop thinking it does.

Did you turn a firewall on during the setup of the KVM?

Did you assign the vmbr0 to your KVM or did you select NAT?

If you accept the defaults when configuring the KVM, once booted, the VM will need its own IP configuration done manually. It really is a simple task.
 
pirateghost: >> Did you turn a firewall on during the setup of the KVM? thx, the Proxmox host server is built from iso, i did not changed anything via SSH, i did not found "Firewall" tab in proxmox. >> Did you assign the vmbr0 to your KVM or did you select NAT? Yes, in VM configuration is vmbr0 and model is VirtIO For my other VM (Centos 5.11) i used NAT. I tried several configurations, nothing worked, so i set to vmbr0 & reboot VM, but still no luck. I think if Gateway IP is needed, i might be entering wrong GW IP in /etc/sysconfig/network-scripts/ifcfg-eth0 (on VM), i asked my server provider, but i got no GW IP from them (i have only one IP assigned (/32). host server GW IP is known, but not sure if that is what i need to set in VM
Of course it needs a gateway. It has no route to the internet without it.

Set the gateway to be the same as the gateway used in host?
 
So i used gateway IP that is mentioned by host server provider, restarted network on VM, but ping 8.8.8.8 result is: network is unreachable. --- The VM ifcfg-eth0 looks like: http://s20.postimg.org/na01c89zh/ifcfg.gif --- resolv.conf contains --- nameserver 8.8.8.8 --- nameserver 8.8.4.4 --- kernel routing table is empty (route -n) --- when i do command: route add default gateway HostServerGatewayIP --- it says: "SIOCADDRT: Network is unreachable" --- Server provider tells me: "You have to route the traffic via your host interface. A /32 is a single standalone IP which is routed to your server. There is no gateway. " . --- "route add default gateway" worked only when i added IP which i want to use on VPS.. then ping is shown, but 100% loss.
 
Last edited:
thx, one ip for host server and one (/32) which i want to use on VPS.. These 2 are not part of one subnet (i mean they are different as i mentioned (pastebin.com link in this thread))
 
Last edited:
I don't understand why they would tell you it has to route to your host. An IP is an IP. It needs a gateway to get to the internet.

Contact them and say "How do I assign this static IP to be able to use the internet?"
Do not mention that it is a VM. That makes no difference.
 
This is the reply: "As I previously said: > You have to route the traffic via your host interface." --- please how to setup that KVM VPS so it has its own IPv4 ?
 
I already told you. It has nothing to do with being a vps. But whatever, I'm done here. You don't want to take the advice given and you think the vps is somehow different from a regular computer on a network.
 
Im sorry, i say KVM VPS because it is KVM VPS, but u understand its normal server, but virtualised. Please kindly advice me how i can proceed if you can. Thank you
 
I told you what to do.

Call your ISP and don't tell them its a virtual machine. Ask for a gateway.
 

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!