We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

Not able to assign IP to VM in server


HTMLtag
2015-11-13, 01:32 PM
Hey Peter,

How many IP's do you want on the VM? If 1, create a unique Mac Address for each IP and VM and assign it to the adapter. (If multiple, they can share a Mac address if doing ip aliasing on the same adapter.) Since you're on VMware, make sure to pick a VMware Mac Address.
If you change the mac address after the VM has started, it may have changed to eth1 due to persistent rules in the OS.
I'm assuming your host is a 46.105.127.x ip, is that correct?
Try using google's nameservers 8.8.8.8, 8.8.4.4.

I use Proxmox/KVM as my Virtual Tech, but I setup a CentOS7 VM to test it out.

Code:
/etc/sysconfig/network-scripts/ifcfg-eth0
------------------------------------------
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=6380c6dd-46fb-4f93-a4dc-5c83044bcc37
DEVICE=eth0
ONBOOT=yes
IPADDR=158.69.55.115
PREFIX=32
GATEWAY=192.99.50.254
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
IPV6_PRIVACY=no

/etc/sysctl.conf (disabled ipv6)
-----------------------------------------
net.ipv6.conf.all.disable_ipv6 = 1

My resov.conf was auto-gen from my network config.
-----------------------------------------
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
I hope this helps.

I assigned a mac address to my virtual adapter that matched the IP I assigned.
This was just a quick setup using the values the installer's network manager did.
You may need to set broadcast to your assigned ip and disable arp broadcasts to comply with some of OVH's policies.

You can try temp assigning the ip via cmd line
Code:
ip addr add 158.69.55.115/32 brd + dev eth0
ip link set eth0 up 
ip route add 192.99.50.254 dev eth0 
ip route add default via 192.99.50.254
Be sure to replace the ip and gateway with your appropriate one.
If trying to ssh in, be sure to install openssh-server.

SGPeter
2015-11-13, 05:23 AM
Hi,
I have the same problem but with a different configuration. OVH is not helping (at all, they're just saying 'it works, good luck, bye'). But the IP's are not reaching the VM's and the gateway is not responding to a ping.

The specs:
VMware 5.0
CentOS 6.7
purchased a 4 IP block
Assigned MAC address to the 4 IPs (same MAC address is that correct?)
changed the ifcfg-eth0 file as follows:
DEVICE = eth0
BOOTPROTO = none
ONBOOT = yes
USERCTL = no
IPV6INIT = no
PEERDNS = yes
TYPE = Ethernet
NETMASK = 255.255.255.255
IPADDR = 51.254.231.205
GATEWAY = 46.105.127.254
ARP = yes
HWADDR = 00:50:56:01:54:5f
Changed the route-eth0 file as follows:
46.105.127.254 dev eth0
default via 46.105.127.254 dev eth0
changed the reslolv.conf file as follows:
nameserver 213.186.33.99

In consol centOS is starting up normally. But the server can't be reached via the IP. The IP bblock is 204,205,206,207.

Any one any idea what we can do to get this to work?
Thanks,
Peter.

andyman1994
2015-08-18, 02:20 AM
Dude HTMLtag is bomb with this stuff he help me many of times

HTMLtag
2015-07-09, 10:24 AM
I'm glad you got it worked out.

Just to answer for people in the future viewing this thread:

The name of the VM can be whatever you want, I usually use my naming prefix that I put in proxmox for my VM.
Type: For proxmox, choose OVH. (There should not be an issue if you do VMware, but the VMware option exists because VMware can only accept a limited range of Mac addresses. I would still choose OVH, unless you hae the need.)

patelbhavin
2015-07-09, 10:19 AM
hye thanks.. i got it..done.. had to try three four options.. but got it done..



thanks for support..

patelbhavin
2015-07-09, 09:54 AM
One more thing to say here. as per reply.. i tired to "Add a virtual MAC" from my control panel. But here i have some confusion.

What should i enter in "Name of VM" and "Type of virtual MAC" only gives two options 1) ovh 2) vmware. As i have said early i have installed proxmox.

can you please guide me on this please.

patelbhavin
2015-07-09, 09:49 AM
Hi,

Guest OS is Centos 6.6.

To mentioned here that i have not done any thing like setup of Virtual Mac address, i just check in my control panel that my new 4 ips are there in list. can you please let me know how should i do it.

HTMLtag
2015-07-09, 09:31 AM
What OS is the Guest?
Did you setup the Virtual Mac address for the IP and associate it with the network adapter in Proxmox?

patelbhavin
2015-07-09, 09:00 AM
Hi,

After long fight at least i was able to activate 4 new IPs in my server plan. I have installed proxmox on my server.

I created one VM in proxmox and assigned IP in to that as per guide given in link below:
http://docs.ovh.ca/en/guides-network-bridging.html

But i m not able to ping server. I tried to ping localhost from server and it works fine. Even i tired to ping self IP of server it also works fine. But as given in above guide gateway of VM should be Main Server IP address ending with .254. I did gave same gateway like last octane of gateway ip .254. But I am not able to ping gateway. Even i m not able to ping google.com or 8.8.8.8 which is google dns server.

can any body help me.

Same I tired to log support ticket but i doubt if any body will respond to it before two three days..