I fixed the gateway issue. It wasn't a wrong InterfaceBlock. I was putting the gateway ip in the wrong place. So that works. And I can switch between Static and DHCP with impunity. I just can use tcp/ip or auto-update when in Static IP.
Looking through the autoupdate.cpp I see that it has lots of debug statements. So I built a debug version of my program and loaded it. Then I tried to load a release build while in Static IP. It loaded! But it didn't output a single debug statement. I then tried to load the same release build again, and it failed.
Changing between Dhcp & Static IP
Re: Changing between Dhcp & Static IP
What's your static IP settings? Does it have a gateway registered? If not, does the destination IP fit in it's subnet?
Dan Ciliske
Project Engineer
Netburner, Inc
Project Engineer
Netburner, Inc
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Changing between Dhcp & Static IP
I copied the function DisplayRuntimeSettings() from NNDKProgman.pdf example on page 24 to my program and call it after every change of ip settings.
On power-up, with DHCP enabled, this is the output:
--- RUNTIME IP SETTINGS ---
Values assigned by DHCP Server
IP runtime settings using Interface Functions for interface 1:
IP: 10.250.5.85
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 10.250.4.229
IP runtime settings using GetInterfaceBlock() for interface 1:
IP: 10.250.5.85
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 10.250.4.229
Interface Name: Ethernet
I change the mode to static ip, and this is the output"
--- RUNTIME IP SETTINGS ---
IP runtime settings using Interface Functions for interface 1:
IP: 10.250.5.127
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 0.0.0.0
IP runtime settings using GetInterfaceBlock() for interface 1:
IP: 10.250.5.127
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 0.0.0.0
Interface Name: Ethernet
On power-up, with DHCP enabled, this is the output:
--- RUNTIME IP SETTINGS ---
Values assigned by DHCP Server
IP runtime settings using Interface Functions for interface 1:
IP: 10.250.5.85
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 10.250.4.229
IP runtime settings using GetInterfaceBlock() for interface 1:
IP: 10.250.5.85
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 10.250.4.229
Interface Name: Ethernet
I change the mode to static ip, and this is the output"
--- RUNTIME IP SETTINGS ---
IP runtime settings using Interface Functions for interface 1:
IP: 10.250.5.127
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 0.0.0.0
IP runtime settings using GetInterfaceBlock() for interface 1:
IP: 10.250.5.127
Mask: 255.255.255.0
Gate: 10.250.5.1
DNS: 0.0.0.0
Interface Name: Ethernet
Re: Changing between Dhcp & Static IP
Lets go waaay back to basics.
Buid a default netburner app
then use the ipsetup tool to switch back and forth between DHCP (an address of 0) and static.
Verify that both ways work... I just want to be 100% sure the static address works correctly on boot without the switch...
Paul.
It could be a netowrk interface issues with ipsetup and autoupdate and have nothing to do with your switch code.
How many interfaces on your PC and what are there ipaddresses?
Buid a default netburner app
then use the ipsetup tool to switch back and forth between DHCP (an address of 0) and static.
Verify that both ways work... I just want to be 100% sure the static address works correctly on boot without the switch...
Paul.
It could be a netowrk interface issues with ipsetup and autoupdate and have nothing to do with your switch code.
How many interfaces on your PC and what are there ipaddresses?
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Changing between Dhcp & Static IP
You're correct, it's a network issue with our network. I moved to another subnet and it tried with a different static address and it works. Our "crack" IT dept is looking into it.
Thanks for all the help.
Thanks for all the help.