All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Need help, something wrong with IPv4 subnet. Windows VMs = internet, Linux = no internet.
Hello.
I have got my first IPv4 subnet ever, and I'm trying to use it.
I have followed this guide from Hetzner to how to setup a subnet.
Everything seems OK. But something is wrong.
A) When I create a Windows VM using the subnet and using DHCP, I get no internett access.
But if I use one of the free IPs from the subnet, it' on internet right away:
Then I create a Linux VM: CentOS 6.6 64bit minimal.iso
Also there DHCP is not working. When I change ONBOOT=yes, and restart the network, I can see that the eth0 card has got the second free IP from my subnet. All seems correct. But still, it's not on the internet. I can't ping anything.
Then I change the setup from DHCP to Static, like on Windows.
I use exact the same settings as I use on Windows, but of course the second IP
But the Linux VM will not go on internet whatever I try.
Here is my settings, and still, no internett. I use /etc/init.d/network restart
after every change I make, and I also reboot the server when the new settings is not working, just to see if that helps.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
ifconfig
vi /etc/resolv.conf
I have just tried with the Google NS, and just with the Hetzner nameservers.
/etc/init.d/network restart
Here I get two errors I don't know anything about. Why do it say that I can't use the Gateway? It's the correct one in the subnet, it's the same as I use on Windows. So why will it not work in Linux?
I have tried to use gateway in the eth0 file and in vi /etc/sysconfig/network
but the same error both places.
Here is some info from my DHCP scope, as you can see, x.2 is dedicated to the server.
I have tried with reservation and without.
Here is the subnet.
What are I'm missing here? Why can I not use DHCP in the first place? (not a big issue, only 6 IPs, so I can use static IP without any problem). But why do static IP work on Windows but not on Linux with the same settings?
I really hope someone here can help me!
Comments
https://technet.microsoft.com/en-us/library/ee941211(v=ws.10).aspx
Got to set the router aka gateway address in the dhcp server
That's whats I'm doing. 144.xxx.xxx.0 is the first in my subnet, used as IP for the subnet NIC with netmask 255.255.0.0
Here is what I get when I just use DHCP, as you can see, the VM gets a IP from the scope, no error messages there. And in
ifconfig
you can see that the VM has got the same IP as from the dhcp scope, broadcast is correct and netmask is correct. (from the data I got from on the subnet), still, no luch getting onlineMake no difference...maybe I have to reboot the entire server before it work?
It do not say so in the guide from MS.
A strange thing: If i set the netmask to= 255.255.0.0 (as it is on the subnet NIC) when I use static IP in Linux, then it's online. Then I do not get any errors when I restart the network.
So then I have solved how I can use static IPs on both Windows and Linux. They need different netmasks.
Still, no luck getting any VM to get online using DHCP, they get IP in DHCP they are in the scope, on status in Windows and ifconfig in Linux, the correct data is showing, but still, they can't go online.
Maybe a stupid question, but do I need to use DHCP on my subnet? If I only are going to use static IPs anyways. Can I just make a new external NIC for Hyper-V and just put the first IP from the subnet there, with the netmask, no gateway and then set nameservers. And so only use the IP's as static IPs?
Or will that not work because the IPs from the subnet has no MAC address?
If 144.x.y.0 is the network IP, then you can't use that also as the gateway IP I think (in the guide the subnet is 192.168.53.72/29 with gateway at 192.168.53.73).
But if I have to use .73 as gateway, I will only have 5 usable IP's left from my /29 subnet. Why do they say that I will have 6 then?
Totally I have 8. In my case it starts at .0, thats the IP I'm using on the internal NIC I created in Hyper-V. The IP .7 is my broadcast IP. And my usable is from .1 - .6
So using .1 for gateway is not correct I think. I shall use .0 as gateway.
But again, do I really need to use DHCP at all on Hyper-V if I only going to set the IPs as static IPs on my VMs?
I only have 6 IPs, so I will manage to have track of the use of them.
Well, it seems like you found a way to use 6 already, but if you're just following the guide it says you have five usable:
And then they used 192.168.53.73 as the gateway / host node IP while 192.168.53.72 is the network.
Yes, for a /29 you can use 5 IPs. There are workarounds, but may not work everywhere and you might be suspended for creating problems, just go the safe way.
@perennate
@Maounique
But if you see here, where you order the flexi pack and extra IPs:
http://www.hetzner.de/ot/hosting/produkte_rootserver/flexipack
/29 (6 usable IPs) /28 (14 usable IPs) /27 (30 usable IPs)
But after starting using x.1 and not .0 on my NIC dhcp is working fine. But then I feel my cheated. Why say that I have 6 usable IPs, when I only have 5?
i like threads like this, education is key
good luck solving your challenges and thanks for sharing the problem.
I don't get it. You are using six, no? One on your host node (x.1), and five on your virtual machines (x.2, x.3, x.4, x.5, x.6).
Yes, you can forward the ports on the node to a VM, people have installed proxmox with only one IP. If you setup a router VM to do this, it is tricky, as the host node must be up to boot the VM and if the VM does not boot, it does not matter if the host node is up or not, it will still be inaccessible, unless you are using IPv6 or KVM.
No my host node has it's own IP, not a part of this subnet.
/29 (6 usable IPs)
But why give me 8 addresses, then say that 6 can be used for VMs, SSL etc? That the first of the 8 is to the NIC (subnet/gateway/router) and the last to broadcast?
Then suddenly I only have 5 addresses...make no sense.
I can't use the x.1 address to VMs or SSL or something like that can I?