Ping ipv4 instead of ipv6

Associate
Joined
10 Nov 2007
Posts
809
Location
Southampton
Good Evening OCUK

When I'm pinging a hostname the reply comes from the ipv6 address instead of the ipv4 address.

Does anyone know how I can make it so the reply is from the ipv4 address instead of the ipv6 address?

EDIT: please note I want to be able to do this without the -4 on the end of the ping command

FYI -4 pings the ipv4 address for those who are not sure :)
 
Last edited:
If i disable ipv6 then i am unable to ping anything. This only happens though when im pinging different dns suffixs. The two machines are hosted on different subnets in a virtual environment with a router server acting as the router. Using lan routong on server 2008. I have a subnet mask of 255.255.255.0 on both subnets. Do i need to change one of them to maybe a class b subnet?
 
When I try to ping the ipv4 address the request times out but works fine if I use the v6 address. Does anyone know how to change this. I have tried disabling ipv6 on the adapter but then I am unable to ping anything at all even if i foce it to use the v4 address.
 
Is this when you try to ping by hostname? What happens when you try and ping by the IPv4 address?

Take a look in your DNS server and check to see if you have any AAAA (IPv6 records) and delete them. On the hostname you are trying to ping, run the command "ipconfig/registerDNS".
 
Is this when you try to ping by hostname? What happens when you try and ping by the IPv4 address?

Take a look in your DNS server and check to see if you have any AAAA (IPv6 records) and delete them. On the hostname you are trying to ping, run the command "ipconfig/registerDNS".

When I ping by ip and host name it fails. I am a beginner with DNS server where would I find AAAA records (If i have any at all)?
 
Lets forget about DNS for the moment. If you have the routing set up correctly (which should just work for directly connected networks), then you should be able to ping between the two machines on IPv4 addresses alone.

What are the operating systems you are trying to ping between? Run an "Ipconfig/all" on all the boxes and paste it back here.

You mention this is in a virtual environment. Is this purely for testing? What Virtual Software are you using?
 
pingone.png

ping2.png


I am using Virtual box and both servers are running server 2008 r2 enterprise

The bridge in the first network is made up of two adapters. one on the 6 network and one on the 7 network. Bridging was the only way I could see of connecting the two networks. Both subnets were 255.255.255.255

I can now ping all devices on the .6 network with ipv4 fine but for some reason cannot ping devices on the .7 network unless i use ipv6. if i force ipv4 it will not work and i get a general failure
 
Last edited:
I havn't done any work with IPv6 so this may be not important, and I may be wrong, but in the 2nd picture it shows the default gateway is on a different subnet, it has a .7.x IP but the default gateway is .6.254. Shouldn't the default gateway be the router interface on that network, otherwise I would have thought that a .7.x IP may not even be able to reach the default gateway.
 
the gateway in the second picture is 192.168.6.254. the ipv4 address is on the .7 network...unless i've read it completly wrong?
 
You mentioned three PCs. You only listed the ipconfig results for two PCs. Are you trying to route traffic between your host machine->Guest VM Router->Guest VM Client? I install three operating systems in 3 VMs and test the routing that way. Also, your router is only displaying one NIC. A router normally has two or more NICs to route traffic between two networks (unless you are creating a 'router on stick'.)

You're right about the second picture being incorrect. You IP address must always be on the same network as the default gateway to route any traffic.

I've created a simple ASCII diagram how you should setup your Operating systems to route traffic.

Host1 ----| Router |---- Host 2
A B C D

A= 192.168.6.1, SNM = 255.255.255.0, DG = 192.168.6.254
B= 192.168.6.254, SNM = 255.255.255.0, NO DG
C= 192.168.7.254, SNM = 255.255.255.0, NO DG
D= 192.168.7.1, SN = 255.255.255.0, DG = 192.168.7.254

The DNS server IP should be the same for all NICS. Set each NIC to use Host-Only networking in Virtual box.

/edit, The ABCD letters don't seem to want to line up correctly. A = Host1, B=Router NIC, C=Router NIC, D= Host 2
 
Last edited:
Cheers for your help Ruskie its very much appriciated :)

I will give this a go at some point tomorrow and let you know how I get on but from looking at that I now understand where I was going wrong.

One thing I did not understand though is would I then need to define static routes on the router server to get the two nics to speak to eachother or something in rras or does windows do this for me automatically?
 
Last edited:
A router should know the directly connected networks, and should be able to route between them without needing to set up static routes.

As Ruskie mentioned, the router should have 1 interface for each network and on the same IP range as that network, and it is that IP that will be the gateway for that network.

The reason you are having issues is that when a computer tries to send data to an IP in a different subnet, it sends it to the default gateway, and if the default gateway is in a different IP range then the computer will have no clue how to send data to reach it
 
Dave

np, I know how difficult it can be learning networking when first starting out ;)

You don't need to create any static routes because the router is directly connected to both subnets so it knows how to route between the two networks.

If you introduced another router then you would have to create some static routes or an easier option is to turn on RIP.
 
the gateway in the second picture is 192.168.6.254. the ipv4 address is on the .7 network...unless i've read it completly wrong?

^ This

With a subnet mask of 255.255.255.0, 192.168.6.254, and 192.168.7.7 are not in the same subnet. If 192.168.7.7 is getting it's address via DHCP, your DHCP server is incorrectly configured. If it is manually set, change it to 192.168.6.7 (unless another machine on the network is already using this address.)
 
I don't use Virtual Box enough to understand how the internal routing is working between machines. The fact you can ping using IPv6 indicates that the VM's are sharing a link layer. I can explain what is likely to be occuring for IPv6.

Each of the VM's will automatically configure its Link-Local IPv6 address. This is identified by the start of the address being fe80::/64. The final 64bits are an modified EUI-64. This is essentially a concatenation of the first 24 bits the ethernet ports MAC address, the hex value FFFE, and the final 24 bits of the MAC address, this string is then hashed with a random number using MD5, producing a new obscure link-local address. (RFC4941 for the details). In Windows 7 you'll see that the link-local address varies overtime.

When pinging the hostnames of the machines, they will learn each others IPv6 address from either DNS if its populated with the AAAA records, or using Link-Local Multicast Name Resolution, which is similar to DNS. Roughly its the same as DNS, but a IPv6 Multicast to FF02::1:3 (special mulitcast address for LLMNR), on udp port 5355. (or a local hosts file, but I suspect you are using LLMNR)

One you have the IPv6 address, Neighbor discovery protocol will use ICMPv6 to multicast a Neighbor Solictation message. I'm not going into the details (if someone really wishes I can, but its very dry reading) but in this instance ICMPv6 is performing the same function as ARP in IPv4, to build a table relating IPv6 address to Link-Layer address. You can see the IPv6 neighbor cache by running the command;
netshow interface ipv6 show neighbors

This will give you a list of all the IPv6 addresses that your machines know about, and are able to communicate with on the local link-layer. It will even flag which devices are routers, if they exist within your IPv6 network.

This is why your pings are working over IPv6. Local networking is simiplfied by the use of the link-local addressing, and its done all the configuration for you. The issues with IPv4 everyone appears to have pointed you in the right direction. The machines are on different IPv4 networks, with no router inbetween, and that should be the reason they are not communicating.
 
Last edited:
Excellent explanation on IPv6 :) This all makes sense now. If you choose local host for each VM, then they still appear on the same physical (virtual) network. You couldn't ping by IPv4 due to incorrectly setting up the IP addresses but you could ping IPv6 due to the reasons in branddaly's post.

Don't worry though, what has already been posted will still work. Its just means all machines will be on the same broadcast domain.

I've performed a similar setup with Vmware a few years ago but I set the VMs on their own physical (virtual) network. I think you can have up to 8.
 
Back
Top Bottom