January 17, 2009, 5:31pm
I made these batch files to switch between Static IP and DHCP in Windows. I use them because I use my laptop’s Wireless at school, and wired to program our robot, but at home I use the Wired.
To use them, just paste the commands in notepad and save as a .bat (EG: “cRIO Mode.bat” or “Internet Mode.bat”)
cRIO / Static IP Mode:
netsh interface ip set address name="Local Area Connection" static 10.23.34.6 255.0.0.0 10.23.34.4 1
NOTE: You need to change the addresses to your team number. We are 10.23.34.*, but you probably aren’t!
netsh interface ip set address "Local Area Connection" dhcp
PS> If you typically use a static IP when not talking to your robot, and you need to configure DNS servers too, then use these commands:
netsh interface ip set dns "Local Area Connection" static 18.104.22.168
netsh interface ip add dns "Local Area Connection" 22.214.171.124 index=2
That sets it to use OpenDNS…
Been switching 4 times a day.
January 17, 2009, 9:59pm
No problem, glad sombody else found it useful!
Helps with more than just robotics. I have to switch all the time for various reasons. This will make life so much easier. Thanks.
January 18, 2009, 10:51am
I got tired of switching back from static to DHCP…
I found a way to set the router to hand out DHCP addresses at 10.XX.XX.6 so your laptop doesn’t have to switch to static.
DHCP router settings can be a problem if you have many laptops that are all trying to program and connect to the router at the same time.
January 18, 2010, 2:55am
Just a tip. If you try to do this with Windows 7 (and I believe Vista as well) the syntax will be slightly different.
netsh interface ip ....
netsh interface ipv4 ....
due to support for IPV6 addresses.
gives help info.
Just so you are aware, you only need to be 10.x.x.6 if you want to be the Dashboard machine.
You can download and/or run using any 10.x.x.* address. The Dashboard.VI even has a forwarding address to redirect that data to another machine.
We setup our wireless router to give out 10.x.x.50 and above IP addresses, so we can still DHCP setup.
10.x.x.1 Wireless Bridge on Robot
10.x.x.4 Wireless Router
10.x.x.5 Driver Station/Classmate
10.x.x.6 Development System
Last year a PC instead of the Classmate with an address of 10.x.x.6 could be used as a Dashboard display machine.
January 18, 2010, 8:50pm
In general, I have noticed that the cRIO and friends are MUCH less finicky about what thier IPs are and such. We only used static for reimaging the cRIO. I have tested numerous network configurations, and both Windriver and the Driver Station (Updated One) seem to always find it.
EG: One of the configs I did was:
cRIO <-> WiFi Brick (The black one)
WiFi Router (One with the blue spoiler) <-> Internet
My dev laptop and Driver Station connected to WiFi router over WiFi. (DS needs to be updated or this fails, set up WiFi network in Developer)
If you do use WiFi with the Classmate, I HIGHLY advise you delete the WiFi profile before competition, the Classmate did not like it with WiFI attempting to work and connection over LAN.
January 28, 2010, 6:50am
I use WinXP Professional at home and office. Although I have the same ISP at both, I am required to change the IP address depending on where I am.
I need one script or batch file that I can run under WinXP that will automatically change my IP from:
172.16.10.23 to 192.168.11.8
Then another script that will change it back.
Hopefully a simple problem if you know how!
January 28, 2010, 2:27pm
Yes, it should be simple. Just use the first command. I belive 10.23.34.6 is the ip address, and 10.23.34.4 is the gateway.
Just put in your addresses!