The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
scp automated script gholdbhurg UNIX for Advanced & Expert Users 5 10-27-2008 01:23 AM
Help needed with automated FTP script leimrod Shell Programming and Scripting 4 07-10-2008 07:06 AM
i want automated script arghya_owen Shell Programming and Scripting 3 06-16-2008 09:02 AM
Need help for automated shell script uneex Shell Programming and Scripting 4 05-01-2008 12:15 PM
help for automated script splax UNIX for Advanced & Expert Users 4 12-26-2006 05:36 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-06-2009
h@foorsa.biz h@foorsa.biz is online now
Registered User
  
 

Join Date: Jun 2008
Posts: 45
Automated script to assign TCP/IP settings automatically after unintentionally unplug

Yesterday i had a situation that cause me headache for a while , I have a web server running win2k3 it has 2 NIC's
one of them assigned to public area network
and the other is not functioning
The place where the server is ,
is messy and cables on the floor so any one can stumble with
cables on the floor and indeed it happened somebody stumbled with the cable and unplugged it form the functioning NIC adapter when s/he returned the cable s/he didn't return it to the right functioning NIC adapter by the way both NIC are enabled
So i made a little trip to place where the server is and begun to do some troubleshooting if you can visualize the situation the unfunction NIC is enabled and it has private ip address so the the icons of connectivity are blinking so i didn't gave care to troubleshoot connectivity after a period i noticed that cable is plugged into the unfunction NIC
so i decided to write a tiny script to handle the situation if someone unplugged the cable and put it and in the unfunction NIC
a college of mine said you could simply assign the other NIC with same TCP/IP settings and he is right and yes its legal to assign same TCP/IP settings to different NIC but it must be disconnected i can do it and make my life much more easier but i decided to automate the process
and write batch script using netsh and automate it as cron job that's all
Code:
(netsh interface show interface | find /i "Local Area Connection" | findstr /B "Enabled" > nul && netsh interface show interface | find /i 
"Local Area Connection" | findstr  "Connected" > nul)
&& (netsh diag ping adapter 1 | find  /I "Reply"  
&& IF %ERRORLEVEL% == 0 echo extra check was successful ) 
|| (echo going to assign TCP/IP settings from a file  & netsh -f c:\location1.txt && echo all is done)
sorry for long
  #2 (permalink)  
Old 02-06-2009
fimblo fimblo is offline
Registered User
  
 

Join Date: Feb 2008
Location: stockholm sweden
Posts: 31
um. this is a unix forum. dont you think it might be better to ask windows people about this issue?
  #3 (permalink)  
Old 02-07-2009
h@foorsa.biz h@foorsa.biz is online now
Registered User
  
 

Join Date: Jun 2008
Posts: 45
Quote:
Originally Posted by fimblo View Post
um. this is a unix forum. dont you think it might be better to ask windows people about this issue?
Thank for response
but its not an issue it's just a tip for automating ip settings and posted it here because the forum is related to networking in general.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0