Þannig er að hérna heima þarf ég helst að sleppa dhcp servernum og úthluta vélunum á netinu hjá mér föstum IP tölvum. Þetta til að port forwarding virki á rétta vél, t.d. þarf ég að geta notað Remote Desktop á ferðatölvuna mínaþegar ég er í vinnunni. Þetta geri ég með því að breyta stillingum á routernum og svo setja upp manual tcp/ip configuration í WindowsXP á ferðavélinni.
Svo vil ég líka geta smellt henni á önnur þráðlaus net úti í bæ en þá er það vandamál þar sem vélin er á manual configuration þannig að ég þarf að taka það allt út, setja á automatic og svo þegar ég kem heim þarf ég aftur að setja inn öll manual gildin.
Er einhver leið til að gera þetta auðveldar? Er td. hægt að setja upp þetta config með script aka .bat skrá eða svoleiðis?
IP configuration í WinXP
-
- Nörd
- Póstar: 126
- Skráði sig: Þri 23. Mar 2004 17:08
- Reputation: 0
- Staðsetning: Atlantshaf
- Staða: Ótengdur
-
Höfundur - Nörd
- Póstar: 113
- Skráði sig: Mán 12. Jan 2004 23:46
- Reputation: 0
- Staðsetning: Kópavogur
- Staða: Ótengdur
amm var latur að googla, algengt vandamál býst ég við, reiknaði með að e-r væri með þetta í hendinni
bara til að láta ykkur vita, fann script til að nota úr dos
http://www.petri.co.il/configure_tcp_ip_from_cmd.htm
bara til að láta ykkur vita, fann script til að nota úr dos
http://www.petri.co.il/configure_tcp_ip_from_cmd.htm
dabbi2000 skrifaði:amm var latur að googla, algengt vandamál býst ég við, reiknaði með að e-r væri með þetta í hendinni
bara til að láta ykkur vita, fann script til að nota úr dos
http://www.petri.co.il/configure_tcp_ip_from_cmd.htm
hmm, linkurinn virkar ekki(hjá mér a.m.k.) en þetta hljómar vel, áttu annan link? eða bara scriptið?
-
- Besserwisser
- Póstar: 3929
- Skráði sig: Sun 27. Okt 2002 00:12
- Reputation: 0
- Staðsetning: Kópavogur
- Hafðu samband:
- Staða: Ótengdur
Virkar hjá mér:
petri.co.il skrifaði:How can I configure TCP/IP settings from the Command Prompt?
In order to configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe.
Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer. Netsh.exe can also save a configuration script in a text file for archival purposes or to help you configure other servers.
Netsh.exe is available on Windows 2000, Windows XP and Windows Server 2003.
You can use the Netsh.exe tool to perform the following tasks:
Configure interfaces
Configure routing protocols
Configure filters
Configure routes
Configure remote access behavior for Windows-based remote access routers that are running the Routing and Remote Access Server (RRAS) Service
Display the configuration of a currently running router on any computer
Use the scripting feature to run a collection of commands in batch mode against a specified router.
What can we do with Netsh.exe?
With Netsh.exe you can easily view your TCP/IP settings. Type the following command in a Command Prompt window (CMD.EXE):Kóði: Velja allt
netsh interface ip show config
With Netsh.exe, you can easily configure your computer's IP address and other TCP/IP related settings. For example:
The following command configures the interface named Local Area Connection with the static IP address 192.168.0.100, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:Kóði: Velja allt
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1
(The above line is one long line, copy paste it as one line)
Netsh.exe can be also useful in certain scenarios such as when you have a portable computer that needs to be relocated between 2 or more office locations, while still maintaining a specific and static IP address configuration. With Netsh.exe, you can easily save and restore the appropriate network configuration.
First, connect your portable computer to location #1, and then manually configure the required settings (such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses).
Now, you need to export your current IP settings to a text file. Use the following command:Kóði: Velja allt
netsh -c interface dump > c:\location1.txt
When you reach location #2, do the same thing, only keep the new settings to a different file:Kóði: Velja allt
netsh -c interface dump > c:\location2.txt
You can go on with any other location you may need, but we'll keep it simple and only use 2 examples.
Now, whenever you need to quickly import your IP settings and change them between location #1 and location #2, just enter the following command in a Command Prompt window (CMD.EXE):Kóði: Velja allt
netsh -f c:\location1.txt
orKóði: Velja allt
netsh -f c:\location2.txt
and so on.
You can also use the global EXEC switch instead of -F:Kóði: Velja allt
netsh exec c:\location2.txt
Netsh.exe can also be used to configure your NIC to automatically obtain an IP address from a DHCP server:Kóði: Velja allt
netsh interface ip set address "Local Area Connection" dhcp
Would you like to configure DNS and WINS addresses from the Command Prompt? You can. See this example for DNS:Kóði: Velja allt
netsh interface ip set dns "Local Area Connection" static 192.168.0.200
and this one for WINS:Kóði: Velja allt
netsh interface ip set wins "Local Area Connection" static 192.168.0.200
Or, if you want, you can configure your NIC to dynamically obtain it's DNS settings:Kóði: Velja allt
netsh interface ip set dns "Local Area Connection" dhcp
As you now see, Netsh.exe has many features you might find useful, and that goes beyond saying even without looking into the other valuable options that exist in the command.