Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Trying to figure something out that makes no sense to me  (Read 5658 times)

0 Members and 1 Guest are viewing this topic.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Trying to figure something out that makes no sense to me
« on: March 26, 2018, 09:44:23 AM »
So I have 2 systems that are connected to an IPv6 setup router. For an older game UT99 for local network play which only supports IPv4, I set both systems to static IP Addresses under the IPv4 configuration of the network adapters. There is a setting for IPv4 and IPv6.

So with IPv4 configured the local game play for hosting UT99 works no problems. I set the IPv4 to 192.168.55.10 and 192.168.55.11 for the 2 computers. And on the one computer I without thinking went to my browser and it was working and I was like.... how am I getting out to the web when i just set these to static IP's with no gateway? It appears that the network adapter can have a dual configuration that i was not aware could be done where the IPv6 still was serving up a connection so that you could surf the internet as well as play the game locally on a different network IP. My IPv6 network addresses resolve to 192.168.0.100 with subnet of 255.255.255.0 and gateway of 192.168.0.1

At first I thought this is really cool because I can set IPv4 for the local game needs and set IPv6 to obtain a dynamic IP from DHCP lease and never have to mess in there again with switching back and forth. But when I went surfing the web it seems as though some websites had no problem with this setup and others werent happy with this. Facebook, Yahoo, Google, and Youtube had no problems with this setup however Steam said I was offline and when going to a bank website it acted as if i was offline.

So I thought ok what happens if I flush my DNS Cache maybe its working because DNS Cache has some stuff stored and so I flushed my DNS Cache and then tried again and same result i can get to some websites and they worked without any problems yet Steam said I was offline and the bank website wouldnt even show the home page for the bank.

So I flushed the DNS cache and rebooted the computer in case somehow its cached elsewhere and upon bringing it back up still same results. So I am confused how some sites work fine and others dont when I am pretty sure I wiped the DNS cache so it must not be using that.

Its almost as if some websites and software that connects over the network is working through IPv6 and others that see IPv4 connection with no gateway are getting roadblocked by the IPv4 configuration.  ::)

I took networking like 20 years ago in college and I thought IPv4 and IPv6 was you have a network adapter set up as one or the other and not both. I have seen before virtual connections where a network adapter can simulate a virtual network connection through a single NIC but I dont see that happening here or if it is not sure where to find that. Usually you would see that when you perform IPCONFIG/ALL.

It would be cool if I could set a rule for IPv4 to work for local lan gaming and everything else use IPv6 connection, but it seems like some stuff is still using the IPv6 and some stuff is trying to use the IPv4 and not sure where to control that.

Lastly I tried this with a Windows 7 64-bit system as well as my Windows 10 64-bit system. Initially I was on my Windows 10 system and thought maybe its a feature of 10 that is allowing for this oddity, so then I turned on my Windows 7 system and set it up the same and got the same results, so the ability to i guess have IPv4 and IPv6 running side by side on a single network adapter goes back as far as at least Windows 7 which I never knew.

When wanting to have 2 network connections of different networks I have always run dual network adapters and had one set to obtain for IPv4 and the other with a static IP address on its own network also IPv4. My brother gave me his old router which was set up for IPv6 and I never went in and reconfigured it because he too has Vonage and no other port forwards etc so I was able to drop it into place and use it without configuring it. I have for years used IPv4 up until this router which replaced my cooked DLink.


DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Trying to figure something out that makes no sense to me
« Reply #1 on: March 26, 2018, 04:53:48 PM »
Had some more time to dig around on this and found that IPv4 and IPv6 can co-exist, and I guess it can be troublesome to get it to work properly. And figured out how its working and not working. Looks like IPv6 still set as obtain automatic an IP address is where most traffic resolves through but Steam and the Banks website are acting as if I am offline because it must be preferring the IPv4 network which has no gateway.  ::)

Going to have to figure out how to point a URL to use IPv6 vs IPv4 I guess for Steam and the Bank and any others that show up as connection issues.

http://www.zdnet.com/article/five-ways-for-ipv6-and-ipv4-to-peacefully-co-exist/
Quote
With Dual-IP stacks, your computers, routers, switches, and other devices run both protocols, but IPv6 will be the preferred protocol. A common procedure is to start by enabling both TCP/IP protocol stacks on the wide area network (WAN) core routers, then perimeter routers and firewalls, followed by your data-center routers and finally the desktop access routers. As the public Internet transitions to IPv6, your network administrators may need to deploy dual-stack capable switches on your; edges earlier.

The upside of this approach is that Dual-IP stacks are supported by all the major operating system and network vendors. The downside is that most legacy networking hardware and servers don't support IPv6. This can lead to such problems as dual-stack edge switches running into DNS (Domain Name Server) problems while users are trying to get to various Internet sites. In addition, many versions of Internet applications, even such commonplace ones as File Transfer Protocol (FTP), won't work with IPv6.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Trying to figure something out that makes no sense to me
« Reply #2 on: March 26, 2018, 07:56:22 PM »
Network connections can usually have both, as you've found. Some stuff doesn't work properly with IPv6.

Steam, from everything I can find, is not IPv6 compatible. Neither are most games.
I was trying to dereference Null Pointers before it was cool.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Trying to figure something out that makes no sense to me
« Reply #3 on: March 27, 2018, 06:43:09 AM »
Figured easier method might be to set the system back to dynamic for IPv4 and IPv6 and instead put an IP configuration batch before launching game to set it to static for IPv4 when game is running and then run a batch after to set it back to dynamic as for its a mess trying to get co-existence IPv4 / IPv6 to behave, but getting an invalid parameter error message and stumped on it. Basically typing in my password, A or B selection for Static or Dynamic and if static hitting the enter key 3 times to pass preset IP info for IP/subnet/gateway and then the game launches on local LAN over IPv4 would be better than having to navigate to network adapter properties and setting that manually each time I want to play the game static and revert back to dynamic after.

Here is the message. Invalid address parameter (1). It should be a valid IPv4 address.

I looked through the help page of netsh and cant find what parameter 1 is. There is an example batch that I used from: https://community.spiceworks.com/how_to/320-batch-file-script-to-change-ip-addresses

Which passes the config to netsh via:  netsh interface ip set address "LAN" static %IP_Addr% %Sub_Mask% %D_Gate% 1

Thinking the 1 was an error I removed it, but when removing it I get a error message of The parameter is incorrect. so the 1 is important there and this parameter (1) must be different from that of that 1 at the tail end of the instruction to pass the network configuration to the system thru netsh

To get this to work from batch requires you to run as admin of the system, so I have one runas batch that calls to this other batch shown below quoted to elevate the privileges to admin before execution of instructions.

Here is the output from running the netsh related batch elevated.

Choose:
[A] Set Static IP
Set DHCP

[A,B]?a
"Please enter Static IP Address Information"
"Static IP Address:"
192.168.55.11
"Default Gateway:"
192.168.55.1
"Subnet Mask:"
255.255.255.0
"Setting Static IP Information"

Invalid address parameter (1). It should be a valid IPv4 address.


Configuration for interface "LAN"
    DHCP enabled:                         Yes
    IP Address:                           192.168.0.107
    Subnet Prefix:                        192.168.0.0/24 (mask 255.255.255.0)
    Default Gateway:                      192.168.0.1
    Gateway Metric:                       0
    InterfaceMetric:                      35
    DNS servers configured through DHCP:  192.168.0.1
    Register with which suffix:           Primary only
    WINS servers configured through DHCP: None

Configuration for interface "Loopback Pseudo-Interface 1"
    DHCP enabled:                         No
    IP Address:                           127.0.0.1
    Subnet Prefix:                        127.0.0.0/8 (mask 255.0.0.0)
    InterfaceMetric:                      75
    Statically Configured DNS Servers:    None
    Register with which suffix:           None
    Statically Configured WINS Servers:   None

Press any key to continue . . .


Quote
@echo off
echo Choose:
echo [A] Set Static IP
echo Set DHCP
echo.
:choice
SET /P C=[A,B]?
for %%? in (A) do if /I "%C%"=="%%?" goto A
for %%? in (B) do if /I "%C%"=="%%?" goto B
goto choice
:A
@echo off
echo "Please enter Static IP Address Information"
echo "Static IP Address:"
set /p IP_Addr=192.168.55.11

echo "Default Gateway:"
set /p D_Gate=192.168.55.1

echo "Subnet Mask:"
set /p Sub_Mask=255.255.255.0

echo "Setting Static IP Information"
netsh interface ip set address "LAN" static %IP_Addr% %Sub_Mask% %D_Gate% 1
netsh int ip show config
pause
goto end

:B
@ECHO OFF
ECHO Resetting IP Address and Subnet Mask For DHCP
netsh int ip set address name = "LAN" source = dhcp

ipconfig /renew

ECHO Here are the new settings for %computername%:
netsh int ip show config

pause
goto end
:end

Thinking once I get this parameter (1) issue fixed this should solve this and hopefully not lead to yet another error message. Any ideas on whats wrong with this?

Lastly important is that LAN is the name of the network adapter your targeting. I changed my network adapter name to LAN to match that of the batch example, otherwise you get another error because invalid target adapter due to wrong name.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Trying to figure something out that makes no sense to me
« Reply #4 on: March 27, 2018, 10:29:34 AM »
Quote
netsh interface ip set address "LAN" static %IP_addr% %Sub_Mask% %D_Gate% 1

"ip" isn't valid anymore. It has to be either ipv4 or ipv6. (This was changed in either Win7 or Vista) In your case, ipv4.
I was trying to dereference Null Pointers before it was cool.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Trying to figure something out that makes no sense to me
« Reply #5 on: March 27, 2018, 07:33:43 PM »
cool thanks BC ... gonna change that to ipv4 and check other commands too

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Trying to figure something out that makes no sense to me
« Reply #6 on: March 27, 2018, 08:01:49 PM »
Made 2 different batches, first one sets the adapter back to DHCP for IPv4 and other one sets the STATIC info. Ran into issues with the original batch I was working with that had the A or B choice. Kept getting invalid parameter and other error messages and so I dumbed it all down and it works dumbed down. Passing IP's via setting in batch the netsh didnt like that at all, so I made it simpler and it worked. Had some issues also trying to elevate the privileges to admin on execution so I will just right-click and select run as admin and go that route for when I want to set preset Static or DHCP I guess as the best solution for this. Sharing this here in case anyone might find it helpful in future as well as  to show that I guess this is done now.

Quote
REM DHCP
@ECHO OFF
ECHO Resetting IP Address and Subnet Mask For DHCP
netsh int ipv4 set address name = "LAN" source = dhcp

ipconfig /renew

ECHO Here are the new settings for %computername%:
netsh int ipv4 show config

pause

Quote
REM STATIC 192.168.55.x
@echo off
netsh interface ipv4 set address name=LAN source=static address=192.168.55.11 mask=255.255.255.0 gateway=192.168.55.1
ipconfig/all
pause