اضافه كردن استاتيك روت به ويندوز Add a static IP route to Windows
چندين راه وجوددارد و ما يكي را كه ساده تر است بيان مينماييم:
ابتدا دستور زير را با هر متريكي كه مد نظر داريد در command prompt خود درج نماييد:
route add 10.0.0.0 mask 255.0.0.0 192.168.0.1 metric 2 -p
اين دستور با متريك 2 هر كس با رنج آي پي 10.0.0.0/8 را كار دارد به سمت اي پي آدرس 192.168.0.1 هدايت ميكند.شما ميتوانيد اين اعداد را متناسب با شبكه خود تغيير دهيد:
كليد p- باعث ميشود اين دستور در مسير زير در جيستري درج گردد:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip \Parameters\PersistentRoutes
اكنون مي توانيد از كليد مزبور يك exportاز درون رجيستري گرفته و روي همه سيستمهايي كه قرار است از اين دستور روتينگ پيروي كنند فقط كافيست فايل رجيستري را با دابل كليك اجرا فرماييد.
نكته: با editنمودن فايل ميتوانيد براحتي آنرا ويرايش كرده براي vlan هاي مختلف استفاده كنيد.
To add a static IP route
- Open Command Prompt.
- At the command prompt, type:
route add destination mask subnetmask gateway metricc ostmetric if interface
where:
Static IP route entry Definition destination
Specifies either an IP address or host name for the network or host.
subnetmask
Specifies a subnet mask to be associated with this route entry. If subnetmask is not specified, 255.255.255.255 is used.
gateway
Specifies either an IP address or host name for the gateway or router to use when forwarding.
costmetric
Assigns an integer cost metric (ranging from 1 through 9,999) to be used in calculating the fastest, most reliable, and/or least expensive routes. If costmetric is not specified, 1 is used.
interface
Specifies the interface to be used for the route that uses the interface number. If an interface is not specified, the interface to be used for the route is determined from the gateway IP address.
route add 10.0.0.0 mask 255.0.0.0 192.168.0.1 metric 2
Notes
- To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.
- To make a static route persistent, you can either enter route add commands in a batch file that is run during system startup or use the -p option when adding routes.
- Routes added by using the -p option are stored in the registry under the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip \Parameters\PersistentRoutes - All symbolic names used for destination or gateway are looked up in the network and computer name database files (Networks and Hosts), which are stored in the local systemroot\System32\Drivers\Etc folder.
- If a route addition fails, you can use the tracert command to verify that the gateway specified is directly reachable from the same subnet as this computer.
Information about functional differences
- Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.
See Also
Concepts
View the IP routing table
Remove a static IP route
IP routing
The IP routing table
TCP/IP database files
Route
منبع : http://technet.microsoft.com/en-us/library/cc757323%28v=ws.10%29.aspx