Networking Forums

Networking Forums > Computer Networking > Broadband > win2000: cmd line utility to set a fixed IP?

Reply
Thread Tools Display Modes

win2000: cmd line utility to set a fixed IP?

 
 
Peter
Guest
Posts: n/a

 
      10-20-2006, 06:26 PM
I need to run something when a user logs in, to change the IP from the
existing one.

IPCONFIG doesn't appear to have an option for setting a specific IP.

Any suggestions much appreciated; also how to run it. I can put a
batch file into the startup folder but that may be easily noticed... I
believe there is a place somewhere to run a command at login time.
 
Reply With Quote
 
 
 
 
Sparks
Guest
Posts: n/a

 
      10-20-2006, 07:10 PM
"Peter" <occassionally-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I need to run something when a user logs in, to change the IP from the
> existing one.
>
> IPCONFIG doesn't appear to have an option for setting a specific IP.
>
> Any suggestions much appreciated; also how to run it. I can put a
> batch file into the startup folder but that may be easily noticed... I
> believe there is a place somewhere to run a command at login time.


Not sure about the app, but you can put it in...
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Run]

(In the registry - start, run regedit)


 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a

 
      10-20-2006, 09:41 PM
On Fri, 20 Oct 2006 19:26:43 +0100, in uk.telecom.broadband , Peter
<occassionally-(E-Mail Removed)> wrote:

>I need to run something when a user logs in, to change the IP from the
>existing one.


Would this be because you want to restrict the access level this user
has to the internet ?

If so, this isn't a good way to do it. Anyone with reasonable computer
savvy will get round it in two minutes, and if this is a managed
network, having the box IP address change irregularly will cause all
sorts of other problems.

>IPCONFIG doesn't appear to have an option for setting a specific IP.


There's no commandline way to do it. You'd have to write some
software.

>Any suggestions much appreciated; also how to run it. I can put a
>batch file into the startup folder but that may be easily noticed... I
>believe there is a place somewhere to run a command at login time.


Setup a login script via group or local policies.
--
Mark McIntyre
 
Reply With Quote
 
Peter
Guest
Posts: n/a

 
      10-21-2006, 06:42 AM

Mark McIntyre <(E-Mail Removed)> wrote

>Would this be because you want to restrict the access level this user
>has to the internet ?
>
>If so, this isn't a good way to do it. Anyone with reasonable computer
>savvy will get round it in two minutes, and if this is a managed
>network, having the box IP address change irregularly will cause all
>sorts of other problems.


It would be OK here. Basically, yes I want to block the particular
user from having net access but allow him the LAN access (printing
etc).

Blocking a specific IP is easy from the router.

How would you do it?

>>IPCONFIG doesn't appear to have an option for setting a specific IP.

>
>There's no commandline way to do it. You'd have to write some
>software.


That suprises me, given that I can do IPCONFIG /RELEASE etc etc from
the command line. So, in effect, one can change (remove) the IP, but
that way one will just get the same one back each time...
 
Reply With Quote
 
Mugwump
Guest
Posts: n/a

 
      10-21-2006, 08:01 AM
In article <(E-Mail Removed)>, occassionally-
(E-Mail Removed) says...
>
> Mark McIntyre <(E-Mail Removed)> wrote
>

SNIP
>
> That suprises me, given that I can do IPCONFIG /RELEASE etc etc from
> the command line. So, in effect, one can change (remove) the IP, but
> that way one will just get the same one back each time...
>

IPCONFIG /RELEASE merely does what it says. On the machine in question,
it releases the lease on the IP and sets everything to 0.0.0.0 on the
NIC. It doesn't do anything to the lease on the DHCP server.

/RENEW will just request a new lease from the DHCP server and since the
lease on the server still has time to run then Yes you will get the same
IP back.

(If you have a static IP set on the machine /RELEASE & /RENEW won't
work)

A managed layer 2 switch can do what you want as it works at the MAC
address level and not IP level. He would need to spoof his MAC or change
his NIC to get around it. Layer 2 switches don't come cheap (compared to
normal switches)
 
Reply With Quote
 
Trevor
Guest
Posts: n/a

 
      10-21-2006, 10:30 AM
Peter wrote:
<snip>
> Blocking a specific IP is easy from the router.
>
> How would you do it?


I not really exactly sure what you're getting at but assuming that:-

a) you can block a specific IP from the router
b) this is a corporate network with a Windows DHCP server handing
out the addresses

Why don't you set up a DHCP reservation so that the user gets the
same IP every time and then block that particular IP at the router

Or if you can't block the IP at the router set up a DHCP
reservation and set the default gateway for that particular
address/reservation as blank (I can't recall offhand exactly how
to do this but its definitely possible.)

Not sure if this helps (Sorry!).

 
Reply With Quote
 
Grant
Guest
Posts: n/a

 
      10-21-2006, 11:04 AM
Peter wrote:
> I need to run something when a user logs in, to change the IP from the
> existing one.


From http://www.petri.co.il/configure_tcp_ip_from_cmd.htm

netsh interface ip set address name="Local Area Connection" static
192.168.0.100 255.255.255.0 192.168.0.1 1


 
Reply With Quote
 
Peter
Guest
Posts: n/a

 
      10-21-2006, 11:19 AM

"Grant" <(E-Mail Removed)> wrote

>Peter wrote:
>> I need to run something when a user logs in, to change the IP from the
>> existing one.

>
>From http://www.petri.co.il/configure_tcp_ip_from_cmd.htm
>
>netsh interface ip set address name="Local Area Connection" static
>192.168.0.100 255.255.255.0 192.168.0.1 1
>

ABSOLUTELY BRILLIANT!!!


Yes it works, too...

example :

netsh interface ip set address "Ethernet" static 192.168.1.175
255.255.255.0 192.168.1.1 1

(all on one line obviously)
 
Reply With Quote
 
Peter
Guest
Posts: n/a

 
      10-21-2006, 11:23 AM

Trevor <zeppo1984@f2s-HALSMAN-.com> wrote

>I not really exactly sure what you're getting at but assuming that:-
>
>a) you can block a specific IP from the router
>b) this is a corporate network with a Windows DHCP server handing
>out the addresses
>
>Why don't you set up a DHCP reservation so that the user gets the
>same IP every time and then block that particular IP at the router
>
>Or if you can't block the IP at the router set up a DHCP
>reservation and set the default gateway for that particular
>address/reservation as blank (I can't recall offhand exactly how
>to do this but its definitely possible.)


The objective was this: there is a PC (win2k) used by a number of
people. Each has their own login. I need to block internet access on
one of these.

There may be a way of doing this under win2k itself (I believe there
is a specific wizard in XP for it) but an easier way is for me to
block a specific (fixed) IP in the router, and make sure the user in
question runs with that IP.

The other post re Petri's site has the answer I want.
 
Reply With Quote
 
Mugwump
Guest
Posts: n/a

 
      10-21-2006, 11:49 AM
In article <(E-Mail Removed)>, occassionally-
(E-Mail Removed) says...
>
> ABSOLUTELY BRILLIANT!!!
>
>
> Yes it works, too...
>
> example :
>
> netsh interface ip set address "Ethernet" static 192.168.1.175
> 255.255.255.0 192.168.1.1 1
>
> (all on one line obviously)


Until somebody changes the connection name.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a CMD-line utility built-in to Windows which will allow me to perform SNMP queries? Spin Windows Networking 6 05-29-2008 10:46 PM
FIXED!!! rothfam98 Wireless Networks 3 02-21-2007 08:26 PM
Pipexs buy Caudwell's fixed line business Sunil Sood Broadband 2 03-24-2006 07:44 AM
dacs removed - not much improvement in dialup speed - line gain/line card banzai Broadband 11 05-19-2004 04:24 PM
DDE and WIN2000 Mark Borzillo Windows Networking 0 09-26-2003 03:56 PM



1 2 3 4 5 6 7 8 9 10 11