Netsh commands for DHCP

Netsh commands for DHCP


The Netsh commands for DHCP offer a command-line tool that helps with the administration of DHCP servers and provides an equivalent alternative to console-based management. This can be useful in the following situations:

• When managing DHCP servers in wide area networks (WANs), commands can be used in interactive mode at the Netsh command prompt to better manage across slow-speed network links.

• When managing a large number of DHCP servers, commands can be used in batch mode at the Netsh command prompt to help script and automate recurring administrative tasks that need to be performed for all DHCP servers.


You can run these commands from the Windows Server 2003 family command prompt or from the command prompt for the Netsh DHCP context. For these commands to work at the Windows Server 2003 family command prompt, you must type netsh dhcp before typing commands and parameters as they appear in the syntax below. There might be functional differences between Netsh context commands on Windows 2000 and the Windows Server 2003 family.

For more information about how to use the Netsh commands that are provided for DHCP, see Use DHCP Command-line Tools .

For an example of how to use Netsh commands for DHCP in batch files and scripts, see Netsh DHCP example .

For more information about Netsh commands, see The Netsh Command-Line Utility .

For more information about netsh, see Netsh overview and Enter a netsh context .

• Netsh DHCP

• Netsh DHCP server

• Netsh DHCP server scope

• Netsh DHCP server mscope


Netsh DHCP
The following commands are available at the dhcp> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

• add server

• delete server

• server

• show server


add server
Adds a DHCP server to the list of authorized servers in Active Directory.

Syntax
addserverServerDNSServerIP

Parameters
ServerDNS
Required. Specifies the DHCP server to add. Identifies the server by DNS domain name.
ServerIP
Required. Specifies the DHCP server to add. Identifies the server by IP address.
Examples
In the following example, this command adds a server with the DNS name dhcpsrv1.example.microsoft.com and IP address 10.2.2.2 to the list of authorized servers in Active Directory.

add server dhcpsrv1.example.microsoft.com 10.2.2.2

Top of page
delete server
Deletes a DHCP server from the list of authorized servers in Active Directory.

Syntax
deleteserverServerDNSServerIP

Parameters
ServerDNS
Required. Specifies the DHCP server to delete. Identifies the server by DNS domain name.
ServerIP
Required. Specifies the DHCP server to delete. Identifies the server by IP address.
Examples
In the following example, this command deletes the server with the DNS name dhcpsrv1.example.microsoft.com and IP address 10.2.2.2 from the list of authorized servers in Active Directory.

delete server dhcpsrv1.example.microsoft.com 10.2.2.2

Top of page
server
Shifts the current Netsh DHCP command-line context to a different DHCP server. Used without parameters, server shifts the current command-line context to the local computer.

Syntax
server [{\\ServerNetBIOSName | \\ServerFQDN | ServerIP}]

Parameters
{ \\ServerNetBIOSName| \\ServerFQDN| ServerIP}
Specifies the DHCP server to which you want to shift the current command-line context. Identifies the server by NetBIOS name, fully qualified domain name (FQDN), or IP address.
Examples
In the first example, this command changes the Netsh DHCP command-line context to the DHCP server with the NetBIOS name \\DHCP-SRV1.

In the second example, this command changes the Netsh DHCP command-line context to the DHCP server with IP address 10.0.0.1.

In the third example, this command changes the Netsh DHCP command-line context to the DHCP server with the FQDN \\example.microsoft.com.

server \\DHCP-SRV1

server 10.0.0.1

server \\example.microsoft.com

Top of page
show server
Displays a list of authorized servers in Active Directory.

Syntax
showserver

Parameters
none

Top of page
Top of page
Netsh DHCP server
The following commands are available at the dhcp server> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

• add class

• add mscope

• add optiondef

• add scope

• delete class

• delete dnscredentials

• delete mscope

• delete optiondef

• delete optionvalue

• delete scope

• delete superscope

• dump

• export

• import

• initiate auth

• mscope

• scope

• set auditlog

• set databasebackupinterval

• set databasebackuppath

• set databasecleanupinterval

• set databaseloggingflag

• set databasename

• set databasepath

• set databaserestoreflag

• set detectconflictretry

• set dnsconfig

• set dnscredentials

• set optionvalue

• set server

• set userclass

• set vendorclass

• show all

• show auditlog

• show bindings

• show class

• show detectconflictretry

• show dnsconfig

• show dnscredentials

• show mibinfo

• show mscope

• show optiondef

• show optionvalue

• show scope

• show server

• show dbproperties

• show serverstatus

• show userclass

• show vendorclass

• show version


add class
Adds a class to the specified DHCP server.

Syntax
add class ClassName [ClassComment] [Data] [[IsVendor=]{0 | 1}] [[IsBinary=]{B | b}]

Parameters
ClassName
Required. Specifies the name of the class to create.
ClassComment
Specifies the comment to associate with the class.
Data
Specifies class data in ASCII or binary format depending on the IsBinary parameter. If unspecified, it is assumed that the format of the data is ASCII.
[ IsVendor=]{0 | 1}
Indicates whether the class to add is a user class or a vendor class: 0-User class (default), 1-Vendor class.
[ IsBinary=]{B | b}
Indicates if the class data is in binary format. If unspecified, it is assumed that the format of the data is ASCII.
Examples
In the first example, this command creates a vendor class named MyClass, with the comment TestClass, and the class data TestDataForMyClass in ASCII format.

In the second example, this command creates a user class named MyUserClass with binary data of 4345335532 (ASCII-CE3U2).

The third example is an alternate command syntax for the second example.

add class MyClass TestClass TestDataForMyClass 1

add class MyUserClass TestClass1 4345335532 B

add class MyUserClass TestClass1 4345335532 0 b

Top of page
add mscope
Adds a multicast scope to the specified DHCP server.

Syntax
add mscopeMscopeName [MscopeComment] [TTL]

Parameters
MscopeName
Required. Specifies the name of the multicast scope to add.
MscopeComment
Specifies a description of the current multicast scope.
TTL
Specifies the Time-To-Live value for the multicast scope. The valid range for this field is 1 to 255, with a default of 32.
Examples
In the following example, this command creates a multicast scope with the name My MultiCast Scope, a comment of MyTestMulticastScope, and a multicast TTL value of 40.

add mscope "My MultiCast Scope" MyTestMulticastScope 40

Top of page
add optiondef
Adds a new option type definition to the specified DHCP server.

Syntax
add optiondefOptCodeOptName{BYTE | WORD | DWORD | STRING | IPADDRESS} [[IsArray=]{0 | 1}] [vendor=VendorClass] [comment=OptComment] [DefValue]

Parameters
OptCode
Required. Specifies the option type to define. Identifies the option type with a unique option code. For the value of the code, choose a number between 0 and 255.
OptName
Required. Specifies the name of the option type.
{BYTE | WORD | DWORD | STRING| IPADDRESS}
Required. Indicates the data type of the option.
[IsArray=]{0 | 1}
Indicates whether the data type is arrayed or non-arrayed: 0-Unary or non-arrayed (default), 1-Arrayed.
vendor=VendorClass
Specifies the vendor class for the option. If unspecified, the default vendor class, the DHCP standard options class, is used.
comment=OptComment
Specifies a comment to add to the new option type definition. If unspecified, the default value is NULL.
DefValue
Specifies a default value to use for this option type, if one is not specified otherwise.
Remarks
• IsArray must be 0 for STRING type options.


Examples
In the first example, this command defines a new option type named ExtensionsPath with code 18, a STRING data type, and joins it to the DHCP standard options class, assigning it a default value of c:\Temp.

In the second and third examples, this command defines a new option type named TestOption with code 231 and an IPADDRESS data type. In the second example, the option is defined to provide only a single IP address. IsArray and DefValue are not necessary because defaults are assumed. In the third example, DefValue, and IsArray are required to create an array containing the IP address values 10.1.1.1, 10.1.1.2, and 10.1.1.3.

add optiondef 18 ExtensionsPath STRING 0 c:\Temp

add optiondef 231 TestOption IPADDRESS

add optiondef 231 TestOption IPADDRESS 1 vendor=MyVendorClass 10.1.1.1 10.1.1.2 10.1.1.3

Top of page
add scope
Adds a scope to the specified DHCP server.

Syntax
add scopeScopeAddressSubnetMaskScopeName[ScopeComment]

Parameters
ScopeAddress
Required. Specifies the scope to add. Identifies the scope by IP network number.
SubnetMask
Required. Specifies the subnet mask for the scope to add.
ScopeName
Required. Specifies an identifying name for the scope.
ScopeComment
Specifies a comment for the scope.
Examples
In the following example, this command adds a scope for the DHCP server with scope address 10.2.2.0, subnet mask 255.255.255.0, a scope name of MyScope, and a scope comment of MyComment.

add scope 10.2.2.0 255.255.255.0 MyScope MyComment

Top of page
delete class
Deletes a class from the specified DHCP server.

Syntax
delete class Name

Parameters
Name
Required. Specifies the user or vendor class to delete.
Examples
In the following example, this command deletes the class named MyClass.

delete class MyClass

Top of page
delete dnscredentials
Deletes the credentials used for all DNS dynamic updates.

Syntax
delete dnscredentials dhcpforceflag

Parameters
none

Top of page
delete mscope
Deletes a multicast scope from the specified DHCP server.

Syntax
delete mscopeMscopeName

Parameters
MscopeName
Required. Specifies the multicast scope to delete. MscopeName is case-sensitive.
Examples
In the following example, this command deletes the multicast scope MyMulticastScope from the currently specified DHCP server.

delete mscope MyMulticastScope

Top of page
delete optiondef
Deletes a defined option type from the specified DHCP server.

Syntax
delete optiondefOptCode [[vendor=]VendorName]

Parameters
OptCode
Required. Specifies the unique identifier for the option type to delete.
vendor=VendorName
Specifies the vendor class name with which the option type is associated. If unspecified, the option type definition is deleted from the non-vendor specific DHCP standard options class.
Examples
In the following example, this command deletes an option type with code 18 from the DHCP standard options class.

delete optiondef 18

Top of page
delete optionvalue
Deletes the current value of the specified option type for the specified DHCP server.

Syntax
delete optionvalueOptCode[[vendor=]VendorClass] [[user=]UserClass]

Parameters
OptCode
Required. Specifies the unique identifier of the global server option with a value to delete.
vendor=VendorClass
Specifies the vendor class name with which the option is associated. If the tag is not included, the global VendorName that was set by set vendorclass is assumed. If the tag is used, but no value is specified, then no vendor class is used. This parameter is available only for computers running Windows 2000 Server.
user=UserClass
Specifies the user class name with which the option is associated. If the tag is not included, the global UserName that was set by set userclass is assumed. If the tag is used, but no value is specified, then no user class is used. This parameter is available only for computers running Windows 2000 Server.
Examples
In the following example, this command deletes the current value of the option type with code 18.

delete optionvalue 18

Top of page
delete scope
Deletes a scope from the specified DHCP server.

Syntax
delete scopeScopeAddress {DHCPNOFORCE | DHCPFULLFORCE}

Parameters
ScopeAddress
Required. Specifies the address of the scope to delete.
{DHCPNOFORCE | DHCPFULLFORCE}
Required. Indicates the force with which the scope will be deleted: DHCPNOFORCE-Deletes the scope if there are no active clients in the scope, DHCPFULLFORCE-Deletes the scope even if there are active clients in the scope.
Examples
In the following example, this command forces the deletion of the scope 10.2.2.0 from the DHCP server and ignores all warnings.

delete scope 10.2.2.0 dhcpfullforce

Top of page
delete superscope
Deletes a superscope from the specified DHCP server.

Syntax
delete superscopeSuperscopeName

Parameters
SuperscopeName
Required. Specifies the name of the superscope to delete.
Remarks
• You can set the superscope from the scope context with the set superscope command.

• The superscope name is case-sensitive.


Examples
In the following example, this command deletes the superscope named My Superscope from the specified DHCP server.

delete superscope "My Superscope"

Top of page
dump
Dumps the configuration of the local DHCP server to the command prompt window when run within the netsh environment.

Syntax
dump

When run at the command prompt or in a batch file, output can be saved in a text file. Used without parameters, this command dumps the configuration of the local server to the command prompt window.

Syntax
netsh dhcp server [IPAddress] dump >[PathAndFileName]

Parameters
IPAddress
Specifies the IP address of the DHCP server for which the configuration is output.
PathAndFileName
Specifies both the location where the file is saved, and the name of the destination file to which to dump DHCP server configuration. If unspecified, the DHCP server configuration is dumped to the command prompt window.
Remarks
• This command dumps the DHCP configuration as text output within the command prompt window. You can copy or redirect this output to a file to view it in a text editor. After file output is obtained, you can use the exec command to configure another DHCP server with the same configuration.

• Before performing the dump command at the source server, reconcile all scopes and fix any reported inconsistencies.

• The following command dumps the current configuration for the local DHCP server (the source) to a text file named Dhcpcfg.dmp. This file can be copied to another (destination) DHCP server and used to recreate the source configuration on it. You can recreate the configuration with the following command:

dump > dhcpcfg.dmp

• Before you use the exec command to execute a dump file at the destination server, complete the following steps:

1.
Close the DHCP console at the destination server. Do not reopen the console until after you have run the exec command.

2.
Delete all default option definitions and any user and vendor classes at the destination server.


• These examples demonstrate how to use the delete optiondef and del class Netsh commands to delete all default option definitions and any user and vendor classes. You can run these commands at the dhcp server> prompt, from within the netsh environment.

• delete optiondef 76

• del class "Default BOOTP Class"

• del class "Microsoft Windows 98 Options"


• On the destination server, the exec command is used to load and execute the saved configuration:

netsh exec dhcpcfg.dmp

• After you use the exec command to load the dump file, you must reconcile all scopes. Use net stop dhcpserver to stop the DHCP Server service and net start dhcpserver to restart it. Once the service is restarted, DHCP database changes take effect.


Examples
The first command, which is run within the netsh environment, dumps the configuration of the local DHCP server to the command prompt window.

The second command, which is run at the command prompt, dumps the configuration of a DHCP server with IP address 192.168.0.1 to a text file named Dhcpcfg.dmp at the location C:\Dhcp\ on the local computer.

The third command, which is run at the command prompt, dumps the configuration of a DHCP server with IP address 192.168.0.1 to a text file named Dhcpcfg.dmp on a shared network folder named \\Backup\Dhcp\.

dump

netsh dhcp server 192.168.0.1 dump > C:\Dhcp\Dhcpcfg.dmp

netsh dhcp server 192.168.0.1 dump > \\Backup\Dhcp\Dhcpcfg.dmp

Top of page
export
Exports the DHCP service configuration to a file.

Syntax
export [Path]FileName {all | ScopeList}

Parameters
[Path] FileName
Required. Specifies, by name, the file where the DHCP configuration will be stored. If the path, the file name, or both contain spaces, quotation marks must be used.
{all | ScopeList}
Required. Specifies which scopes you want to export. The parameter all exports all scopes. The parameter ScopeList exports the scopes that correspond to the IP addresses you list. Each IP address in the list must be separated by spaces.
Remarks
• This command works only on the local server.

• While the export command runs, the DHCP service is stopped and does not respond to DHCP clients seeking new leases or lease renewals.

• If the DHCP service has a large number of scopes or a large number of client address leases, this command can take a long time to run.


Examples
In the first example, this command exports the complete DHCP service configuration to the file c:\Temp\Dhcpdb.

In the second example, this command exports the DHCP configuration for scopes 10.0.0.0 and 192.168.0.0 to the file c:\Temp\Dhcpdb.

In the third example, this command exports the complete DHCP service configuration to the file c:\My Folder\Dhcp Configuration. Note that both the path and file name contain spaces, so quotation marks are used.

export c:\Temp\Dhcpdb all

export c:\Temp\Dhcpdb 10.0.0.0 192.168.0.0

export "c:\My Folder\Dhcp Configuration" all

Top of page
import
Imports a DHCP service configuration from a file to the local service.

Syntax
import [Path]FileName {all | ScopeList]

Parameters
[Path] FileName
Required. Specifies, by name, the file from which the DHCP configuration will be imported. If the path, the file name, or both contain spaces, quotation marks must be used.
{all | ScopeList}
Required. Specifies which scopes you want to import. The parameter all imports all scopes represented in the file you specify. The parameter ScopeList imports the scopes that correspond to the IP addresses you list. Each IP address in the list must be separated by spaces.
Remarks
• This command works only on the local server.

• While the import command runs, the DHCP service is stopped and does not respond to DHCP clients seeking new leases or lease renewals.

• If the DHCP service has a large number of scopes or a large number of client address leases, this command can take a long time to run.


Examples
In the first example, this command imports the complete DHCP service configuration from the file c:\Temp\Dhcpdb.

In the second example, this command imports the DHCP configuration for scopes 10.0.0.0 and 192.168.0.0 from the file c:\Temp\Dhcpdb

In the third example, this command imports the complete DHCP service configuration from the file c:\My Folder\Dhcp Configuration. Note that both the path and file name contain spaces, so quotation marks are used.

import c:\Temp\Dhcpdb all

import c:\Temp\Dhcpdb 10.0.0.0 192.168.0.0

import "c:\My Folder\Dhcp Configuration" all

Top of page
initiate auth
Initiates authorization of the specified DHCP server in Active Directory.

Syntax
initiate auth

Parameters
none

Top of page
mscope
Switches the command context to a DHCP multicast scope.

Syntax
mscopeMscopeName

Parameters
MscopeName
Required. Specifies the name of the multicast scope to which to switch the command context.
Remarks
• This command enables you to use any of the available DHCP multicast scope-level commands on the specified DHCP multicast scope. Subsequent operations will be performed on this multicast scope at the specified server.

• The name of the multicast scope is case-sensitive.


Examples
In the following example, this command switches the command context to a multicast scope named My Multicast Scope.

mscope "My Multicast Scope"

Top of page
scope
Switches the command context to a DHCP scope.

Syntax
scopeScopeIPAddress

Parameters
ScopeIPAddress
Required. Specifies the scope to which to switch the command context. Identifies the scope by network or subnet IP address.
Remarks
• This command enables you to use any of the available DHCP scope-level commands on the specified DHCP scope. Subsequent operations will be performed on this scope at the specified server.


Examples
In the following example, this command switches the command context to the scope with IP address 10.0.0.0.

scope 10.0.0.0

Top of page
set auditlog
Sets the audit log path parameters for the specified DHCP server.

Syntax
set auditlogNewAuditPath

Parameters
NewAuditPath
Required. Specifies a local folder for the DHCP server to use when storing audit log files. A valid folder path is required, and the folder must be local to the DHCP server where the path is defined.
Remarks
• In order for this change to take effect, you need to stop and restart the DHCP service after you run this command.


Examples
In the following example, this command sets the DHCP server to store audit log files in the directory c:\logpath.

set auditlog c:\logpath

Top of page
set databasebackupinterval
Sets the backup interval for the specified DHCP server.

Syntax
set databasebackupintervalNewInterval

Parameters
NewInterval
Required. Specifies the backup interval in minutes.
Examples
In the following example, this command sets the database backup interval for the specified DHCP server to 1,440 minutes (24 hours).

set databasebackupinterval 1440

Top of page
set databasebackuppath
Sets the database backup path for the specified DHCP server.

Syntax
set databasebackuppathNewBackupPath

Parameters
NewBackupPath
Required. Specifies a local folder for the DHCP server to use when storing audit log files. A valid folder path is required, and the folder must be local to the DHCP server where the path is defined.
Examples
In the following example, this command sets the database backup path to c:\windows\dhcp\backup.

set databasebackuppath c:\windows\dhcp\backup

Top of page
set databasecleanupinterval
Sets the database cleanup interval of the specified DHCP server.

Syntax
set databasecleanupintervalNewInterval

Parameters
NewInterval
Required. Specifies the database cleanup interval, in minutes.
Examples
In the following example, this command sets the database cleanup interval to 10,080 minutes (every seven days).

set databasecleanupinterval 10080

Top of page
set databaseloggingflag
Sets or resets the database logging flag for the specified DHCP server. Used without parameters, this command resets the database logging flag.

Syntax
set databaseloggingflag [{0 | 1}]

Parameters
{0 | 1}
Indicates the database logging flag setting: 0-Resets the flag (default), 1-Sets the flag.
Examples
In the following example, this command resets the database logging flag for the currently specified DHCP server.

set databaseloggingflag 0

Top of page
set databasename
Sets the name of the DHCP server database file for the specified DHCP server.

Syntax
set databasenameNewFileName

Parameters
NewFileName
Required. Specifies a new name for the DHCP server database file.
Remarks
• In order for this change to take effect, you need to stop and restart the DHCP Server service.


Examples
In the following example, this command sets the DHCP server database file name to newdatabase.mdb.

set databasename newdatabase.mdb

Top of page
set databasepath
Sets the path of the DHCP server database file for the specified DHCP server.

Syntax
set databasepathNewPath

Parameters
NewPath
Required. Specifies the path of the DHCP database file.
Remarks
• In order for this change to take effect, you need to stop and restart the DHCP Server service.


Examples
In the following example, this command sets the path of the DHCP server database file to c:\windows\dhcp.

set databasepath c:\windows\dhcp

Top of page
set databaserestoreflag
Sets or resets the database restore flag for the specified DHCP server. Used without parameters, this command resets the database restore flag.

Syntax
set databaserestoreflag [{0 | 1}]

Parameters
{0 | 1}
Indicates the setting of the database restore flag: 0-Resets the flag (default), 1-Sets the flag.
Examples
In the following example, this command sets the database restore flag for the currently specified DHCP server.

set databaserestoreflag 1

Top of page
set detectconflictretry
Sets the number of conflict detection attempts for the specified DHCP server.

Syntax
set detectconflictretryRetryNumber

Parameters
RetryNumber
Required. Specifies the number of conflict detection attempts that the DHCP server will make before it leases a scope IP address to a client.
Remarks
• The maximum value for RetryNumber is five. All values greater than five will default down to five.


Examples
In the following example, this command sets the DHCP server to make four attempts to detect if a there is a conflict for a scope IP address before the DHCP server uses this scope IP address in a new address lease.

set detectconflictretry 4

Top of page
set dnsconfig
Sets the DNS dynamic update configuration for the specified DHCP server.

Syntax
set dnsconfig [Enable=]{0 | 1} [[Update=]{0 | 1}] [[Lookup=]{0 | 1}] [[NonDyn=]{0 | 1}]

Parameters
[Enable=]{0 | 1}
Required. Indicates whether to enable or disable the dynamic updates of DNS client information: 0-Disables dynamic updates of DNS client information, 1-Enables dynamic updates of DNS client information.
[Update=]{0 | 1}
Indicates the type of update lookups: 0-Updates according to client request, 1-Updates forward and reverse name lookups.
[Lookup=]{0 | 1}
Indicates whether to enable or disable forward lookups for clients when leases expire: 0-Disables forward lookups, 1-Enables forward lookups.
[NonDyn=]{0 | 1}
Indicates whether to update DNS information for clients that do not support dynamic updates: 0-Disables updates for clients that do not support dynamic updates, 1-Enables these updates.
Remarks
• This command is only supported for DHCP servers running Windows 2000 Server and members of the Windows Server™ 2003 family.

• The configured Preferred DNS server, in the TCP/IP properties of the DHCP server, will be updated with DHCP client records when dynamic updates are enabled. If the Preferred DNS server is not available on the network, the Alternate DNS server will be updated.


Examples
In the following example, this command enables the dynamic update of DNS information by the DHCP server and configures updates to always be made for both forward and reverse lookups. This example also disables the option to perform forward lookups when leases expire and enables updates for non-dynamic clients.

set dnsconfig 1 1 0 1

Top of page
set dnscredentials
Sets DNS dynamic update credentials for the specified DHCP server.

Syntax
set dnscredentialsUserName Domain Password

Parameters
UserName
Required. The user name associated with a valid domain account.
Domain
Required. The domain in which the user account is located.
Password
Required. The password for the user account.
Examples
In the first example, this command sets the DNS dynamic update credentials to the values specified.

In the second example, this command sets the value of UserName to User1 and the value of Domain to Domain1, but the password is not specified. Instead an asterisk (*) is used. When an asterisk (*) is used in place of a valid password, the user is prompted for a password. Without the correct password for the specified UserName, the credentials cannot be changed.

set dnscredentials User1 Domain1 Password1

set dnscredentials User1 Domain1 *

Top of page
set optionvalue
Sets a DHCP server option value that will be applied for all scopes defined at the specified DHCP server.

Syntax
set optionvalueOptCode {BYTE | WORD | DWORD | STRING | IPADDRESS} [[user=]UserName] [[vendor=]VendorName] [OptionValue]

Parameters
OptCode
Required. Specifies the unique identifier for the option type with the value to set.
{BYTE | WORD | DWORD | STRING | IPADDRESS}
Required. Specifies the data type for the option type with the value to set.
[user=]UserName
Sets the applicable user class name to which this command will apply. If unspecified, the default user class is assumed.
[vendor=]VendorName
Sets the applicable vendor class name to which this command will apply. If unspecified, the DHCP standard options class is assumed.
[OptionValue]
Specifies the new server default value for the option type identified by OptCode. The value must be of the associated data type.
Remarks
• Vendor and user classes are supported only for DHCP servers running Windows 2000 Server.

• To modify the current defaults for an unspecified class, use either set userclass or set vendorclass commands.


Examples
In the first example, this command sets the value of option code 003 to list two router IP addresses, 10.1.1.1 and 10.1.1.2.

In the second example, this command further qualifies the first example and sets the specified value to apply only for those scope clients that identify themselves as members of the vendor class Vendor1. In order for this example to work, this class must already be defined at the server, with the specified option type defined for its use.

set optionvalue 003 IPADDRESS 10.1.1.1 10.1.1.2

set optionvalue 003 IPADDRESS vendor=Vendor1 10.1.1.1 10.1.1.2

Top of page
set server
Changes the Netsh command-line context to the specified server. Used without parameters, the local server is assumed.

Syntax
set server[{ServerIP | \\ServerDNS}]

Parameters
{ServerIP | \\ServerDNS}
Specifies the IP address or the DNS name of the specified DHCP server.
Remarks
• When this command is used, and the Netsh command-line context is changed to another server, all subsequent command operations are performed on the specified server. To perform command operations on another server, this command must be executed again, with the IP address or DNS name of the new server provided as the parameter.


Examples
In the following example, this command switches the DHCP server command-line context to the server at IP address 10.1.1.1

set server 10.1.1.1

Top of page
set userclass
Sets the name for the current user class. Used without parameters, the current user class is reset to the default user class

Syntax
set userclass [UserClass]

Parameters
UserClass
Specifies the name of the user class for the currently specified DHCP server.
Remarks
• This command is available only for use with DHCP servers running Windows 2000 Server.


Examples
In the first example, this command sets the user class name to MyUserClass.

In the second example, this command resets the current user class to the default user class.

set userclass MyUserClass

set userclass

Top of page
set vendorclass
Sets the name for the current vendor class. Used without parameters, the current vendor class is reset to the default class, DHCP standard options.

Syntax
set vendorclass [VendorClass]

Parameters
VendorClass
Specifies the name of the vendor class for the current server.
Remarks
• This command is available only for use with DHCP servers running Windows 2000 Server.


Examples
In the first example, this command sets the vendor class name to MyVendorClass.

In the second example, this command resets the current vendor class to the default class, DHCP standard options.

set vendorclass MyVendorClass

set vendorclass

Top of page
show all
Displays all status and configuration information for the specified DHCP server.

Syntax
show all

Parameters
none

Remarks
• This command lists all current server status and configuration details, including the stored management information base (MIB) information, for the currently specified DHCP server.


Top of page
show auditlog
Displays all audit log information for the specified DHCP server.

Syntax
show auditlog

Parameters
none

Top of page
show bindings
Displays bindings information for the specified DHCP server.

Syntax
show bindings

Parameters
none

Remarks
• This command displays bindings information for the current DHCP server, indicating which active network connections that are configured with static IP addresses are enabled or disabled for use in servicing DHCP clients on your network.

• The DHCP service automatically disables network connections that obtain their IP address configuration dynamically from service bindings. This happens by default.


Top of page
show class
Enumerates and displays all class information for the specified DHCP server. This includes both user and vendor class information.

Syntax
show class

Parameters
none

Top of page
show detectconflictretry
Displays the configured number of conflict detection attempts for the specified DHCP server.

Syntax
show detectconflictretry

Parameters
none

Remarks
• This command displays the current number of ping retries that are used to attempt the detection of address conflicts for the scope IP addresses that are distributed by the server.


Top of page
show dnsconfig
Displays the DNS dynamic update configuration for the specified DHCP server.

Syntax
show dnsconfig

Parameters
none

Remarks
• If DNS configuration has not been enabled or set, you can use the DNS console or the set dnsconfig command to configure these settings.


Top of page
show dnscredentials
Displays the current DNS dynamic update credentials.

Syntax
show dnscredentials

Parameters
none

Top of page
show mibinfo
Displays management information base (MIB) information for the specified DHCP server.

Syntax
show mibinfo

Parameters
none

Top of page
show mscope
Displays all information about multicast scopes for the specified DHCP server.

Syntax
show mscope

Parameters
none

Top of page
show optiondef
Displays all defined and available options types for use at the specified DHCP server. Used without parameters, all options are displayed.

Syntax
show optiondef [vendor=VendorName]

Parameters
vendor=VendorName
Indicates which defined and available option types to display. If unspecified, the default for VendorName is the default vendor class that is currently set for the DHCP server.
Remarks
• The default vendor class can be reset with the set vendorclass command.

• VendorName is applicable only for DHCP servers running Windows 2000 Server.


Examples
In the first example, this command displays all defined option types for the current vendor class.

In the second example, this command displays the defined option types that are available for use with the specified class Vendor1.

show optiondef

show optiondef vendor=Vendor1

Top of page
show optionvalue
Displays all of the available option values that are currently set for the specified DHCP server. Used without parameters, all option values are displayed, including those that are used for both user and vendor classes.

Syntax
show optionvalue[{user=UserName | vendor=VendorName}]

Parameters
user=UserName
Specifies the default values that are set for the option types that are available for use with the currently set user class.
vendor=VendorName
Specifies the default values that are set for the option types that are available for use with the currently set vendor class.
Remarks
• User=UserName and vendor=VendorName are only available for use with DHCP servers running Windows 2000 Server.

• If you provide values for UserName or VendorName, the respective tags (user= or vendor=) are required. If the tags are not included, the default that is assumed is the current user class, previously set with the set userclass command.


Examples
In the following example, this command displays all of the available option types that have values set at the currently specified DHCP server.

show optionvalue

Top of page
show scope
Displays information about the scopes for the specified DHCP server.

Syntax
show scope

Parameters
none

Top of page
show server
Displays information about the specified DHCP server, including the fully qualified domain name and IP address of the server.

Syntax
show server

Parameters
none

Top of page
show dbproperties
Displays information about server database configuration for the specified DHCP server.

Syntax
show dbproperties

Parameters
none

Remarks
• This command displays the following database configuration information:

• DatabaseName

• DatabasePath

• DatabaseBackupPath

• DatabaseBackupInterval

• DatabaseLoggingFlag

• DatabaseRestoreFlag

• DatabaseCleanupInterval



Top of page
show serverstatus
Displays status information for the specified DHCP server.

Syntax
show serverstatus

Parameters
none

Remarks
• This is an example of the type of status information that this command displays:

Server Attrib - Server Servicing Clients :TRUE

Server Attrib - Dynamic BootP Support Enabled :TRUE

Server Attrib - DHCP Server Part Of DS :TRUE

Server Attrib - DHCP Server Bindings Aware :TRUE

Server Attrib - Administrative Rights :TRUE


Top of page
show userclass
Displays the current user class setting at the specified DHCP server.

Syntax
show userclass

Parameters
none

Remarks
• This is an example of the type of setting information that this command displays:

Current Class Name set for the Server dhcpsrv1.example.microsoft.com is None.


Top of page
show vendorclass
Displays the current vendor class setting at the specified DHCP server.

Syntax
show vendorclass

Parameters
none

Remarks
• This is an example of the type of setting information that this command displays:

Current Vendor Name set for the Server dhcpsrv1.example.microsoft.com is None.


Top of page
show version
Displays current version information for the specified DHCP server.

Syntax
show version

Parameters
none

Remarks
• This is an example of the type of version information that this command displays:

The version of the DHCP Server 192.168.0.100 is 5.6.


Top of page
Top of page
Netsh DHCP server scope
The following commands are available at the dhcp server scope> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

• add excluderange

• add iprange

• add reservedip

• delete excluderange

• delete iprange

• delete lease

• delete optionvalue

• delete reservedip

• delete reservedoptionvalue

• dump

• initiate reconcile

• set comment

• set name

• set optionvalue

• set reservedoptionvalue

• set scope

• set state

• set superscope

• show clients

• show clientsv5

• show excluderange

• show iprange

• show optionvalue

• show reservedip

• show reservedoptionvalue

• show scope

• show state


add excluderange
Adds a range of addresses to exclude from distribution in the current scope.

Syntax
add excluderangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the exclusion range.
EndIP
Required. Specifies the IP address that ends the exclusion range.
Examples
In the following example, this command excludes the IP addresses in the range 10.2.2.10 to 10.2.2.20 from distribution in the scope.

add excluderange 10.2.2.10 10.2.2.20

Top of page
add iprange
Adds a range of IP addresses to the current scope.

Syntax
add iprangeStartIPEndIP [{DHCP | BOOTP | BOTH}] [MaxBootP]

Parameters
StartIP
Required. Specifies the IP address that starts the range.
EndIP
Required. Specifies the IP address that ends the range.
{DHCP | BOOTP | BOTH}
Specifies the type of client to be serviced by this scope and IP range. DHCP is the default.
MaxBootP
Specifies the maximum number of BOOTP clients.
Remarks
• MaxBootP is useful only if ClientType is set to support BOOTP-type clients for the scope. If an optional command-line option is used, all command-line options (mandatory as well as optional) that come before the optional command that is used are required and must appear in proper sequence.


Examples
In the following example, this command adds DHCP clients that are in the IP address range 10.2.2.10 to 10.2.2.20 to the distribution range in the scope.

add iprange 10.2.2.10 10.2.2.20

Top of page
add reservedip
Reserves an IP address for use by a specified media access control (MAC) address in the current scope.

Syntax
add reservedipReservedIPMACAddress [ClientName] [ClientComment] [{DHCP | BOOTP | BOTH}]

Parameters
ReservedIP
Required. Specifies the IP address to reserve.
MACAddress
Required. Specifies the physical hardware or MAC address to associate with the reserved IP address.
ClientName
Specifies a client name to associate with this reserved client entry. If unspecified, a client name is not associated with this reserved client entry.
ClientComment
Specifies a client comment to associate with this reserved client entry. If unspecified, a client comment is not associated with this reserved client entry.
{DHCP | BOOTP | BOTH}
Specifies the type of clients to associate with this reserved client entry. DHCP is the default.
Remarks
• If an optional command-line option is used, all command-line options (mandatory as well as optional) that come before the optional command-line option that is used are required and must appear in proper sequence.


Examples
In the following example, this command reserves the IP address 10.2.2.32 for use by the DHCP client that identifies its MAC address as 08-00-2b-30-36-9b when it obtains a lease in the current scope.

add reservedip 10.2.2.32 08002b30369B

Top of page
delete excluderange
Deletes a range of previously excluded IP addresses from the current scope.

Syntax
delete excluderangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the exclusion range.
EndIP
Required. Specifies the IP address that ends the exclusion range.
Examples
In the following example, this command deletes the exclusion range that starts with an IP address of 10.2.1.5 and ends with an IP address of 10.2.1.10 from the current scope.

delete excluderange 10.2.1.5 10.2.1.10

Top of page
delete iprange
Deletes a range of IP addresses from the current scope.

Syntax
delete iprangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the range to delete.
EndIP
Required. Specifies the IP address that ends the range to delete.
Examples
In the following example, this command deletes IP addresses in the range 10.2.1.5 to 10.2.1.10 from the current scope.

delete iprange 10.2.1.5 10.2.1.10

Top of page
delete lease
Deletes an IP address lease from the current scope.

Syntax
delete lease [{LeaseIP | \\HostName | AllBadAddresses | AllRasServerAddresses}]

Parameters
{LeaseIP | \\HostName | AllBadAddresses | AllRasServerAddresses}
Required. Specifies the IP address or the host name associated with the leased address. If AllBadAddresses is specified, all records marked as BAD_ADDRESS are removed. If AllRasServerAddresses is specified, all leases obtained by all Routing and Remote Access Service servers are removed.
Examples
In the first example, this command deletes the IP address lease 10.2.1.32 from the current scope.

In the second example, this command deletes all IP address leases marked as BAD_ADDRESS from the current scope.

delete lease 10.2.1.32

delete lease AllBadAddresses

Top of page
delete optionvalue
Removes or clears the currently set scope option value from the current scope.

Syntax
delete optionvalueOptCode[user=UserName] [vendor=VendorName]

Parameters
OptCode
Required. Specifies the unique identifier of the option whose value is to delete.
user=UserName
Specifies the user class from which to delete the currently set option value. If the tag is provided, but the value unspecified, the current default user class is assumed.
vendor=VendorName
Specifies the vendor class from which to delete the currently set option value. If the tag is provided, but the value unspecified, the current default vendor class is assumed.
Remarks
• Vendor and user classes are only supported for DHCP servers running Windows 2000 Server.

• If you specify a user class, a vendor class, or both, this command deletes the set option value from only the scope clients that are identified as members of the specified class or classes.

• To modify the current defaults for an unspecified class that is used with this command, use either the set userclass or set vendorclass commands.


Examples
In the first example, this command deletes the currently set option value for option code 18 from the current scope.

In the second example, this command deletes the currently set option value for option code 18 from the vendor class MyVendorClass.

delete optionvalue 18

delete optionvalue 18 vendor="MyVendorClass"

Top of page
delete reservedip
Deletes a reservation for an IP address in the current scope.

Syntax
delete reservedipReservedIPMACAddress

Parameters
ReservedIP
Required. Specifies the IP address reservation to delete from the current scope.
MACAddress
Required. Specifies the media access control (MAC) or physical hardware address string for which the IP address was reserved.
Examples
In the following example, this command removes the IP address reservation 10.2.1.32 for the MAC address 08002B30369B from the current scope.

delete reservedip 10.2.1.32 08002B30369B

Top of page
delete reservedoptionvalue
Deletes an option value that is currently assigned to a reserved client in the current scope.

Syntax
delete reservedoptionvalueReservedIPOptCode [User=UserName] [vendor=VendorName]

Parameters
ReservedIP
Required. Specifies the IP address of the reserved client.
OptCode
Required. Specifies the unique code for the option type that is currently assigned to the reserved client.
User=UserName
Specifies the user class from which to delete the option value. If the tag is provided, but no value is specified, the current default user class is assumed.
vendor=VendorName
Specifies the vendor class from which to delete the option value. If the tag is provided, but no value is specified, the current vendor class is assumed.
Remarks
• Vendor and user classes are only supported for DHCP servers running Windows 2000 Server.

• To modify the current defaults for an unspecified class used with this command, use either set userclass or set vendorclass.


Examples
In the following example, this command deletes the currently set option value for the option identified by code 18 for reserved IP address of 10.2.2.32 in the current scope.

delete reservedoptionvalue 10.2.2.32 18

Top of page
dump
Dumps the configuration of the current scope to the command prompt window when run within the netsh environment.

Syntax
dump

When run at the command prompt or in a batch file, output can be saved in a text file. Used without parameters, this command dumps the configuration of the current scope to the command prompt window.

Syntax
netsh dhcp server {ServerName | IPAddress} scope ScopeID dump >[PathAndFileName]

Parameters
ServerName | IPAddress
Specifies the server name or IP address of the DHCP server for which the scope configuration is output.
ScopeID
Required. Specifies the IP address of the scope for which the configuration is output.
PathAndFileName
Specifies both the location where the file is saved, and the name of the destination file to which to dump the scope configuration. If unspecified, the scope configuration is dumped to the command prompt window.
Examples
The first command, which is run within the netsh environment, dumps the configuration of the current scope to the command prompt window.

The second command, which is run from the command prompt, dumps the configuration of the local server scope 192.168.1.0 to a file named Scopecfg.dmp on the shared network folder \\Backup\Dhcp\.

dump

netsh dhcp server scope 192.168.1.0 dump >\\Backup\Dhcp\Scopecfg.dmp

Top of page
initiate reconcile
Checks and reconciles the current scope. Used without parameters, this command verifies the scopes and check for inconsistencies but does not fix any inconsistencies that it finds in the database.

Syntax
initiate reconcile [fix]

Parameters
[fix]
Indicates that the command will fix, if possible, any inconsistencies that it finds in the database.
Examples
In the first example, this command verifies the scopes and checks for inconsistencies.

In the second example, this command verifies the scopes, checks for inconsistencies, and fixes any inconsistencies that are found.

initiate reconcile

initiate reconcile fix

Top of page
set comment
Sets the comment for the current scope. Used without parameters, set comment deletes the current comment.

Syntax
set comment [NewComment]

Parameters
[NewComment]
Specifies a new or modified comment string for the scope.
Examples
In the first example, this command sets a comment string that has no spaces.

In the second example, this command sets a comment string that includes spaces.

set comment NewCommentNoSpaces

set comment "New Comment With Spaces"

Top of page
set name
Sets the name of the current scope.

Syntax
set nameNewName

Parameters
NewName
Required. Specifies the new name of the scope.
Examples
In the first example, this command sets a name that has no spaces.

In the second example, this command sets a name that includes spaces.

set name NewNameNoSpaces

set name "New Name With Spaces"

Top of page
set optionvalue
Sets an option value for the current scope.

Syntax
set optionvalueOptCode{BYTE | WORD | DWORD | STRING | IPADDRESS} [user=UserName] [vendor=VendorName] OptionValue

Parameters
OptCode
Required. Specifies the code for the option type whose value is to be set.
{BYTE | WORD | DWORD | STRING | IPADDRESS}
Required. Specifies the data type for the option type whose value is to be set.
user=UserName
Specifies the user class. If the tag is provided, but the value is unspecified, the current default user class is assumed.
vendor=VendorName
Specifies the vendor class. If the tag is provided, but the value is unspecified, the current default vendor class is assumed.
OptionValue
Required. Specifies the assigned value for the option type that is specified in OptCode. If the option type supports an array that contains more than a single numeric or IP address value, provide the additional values, in the order that you prefer them, at the end of the command, with each value separated by a space.
Remarks
• Vendor and user classes are only supported for DHCP servers running Windows 2000 Server.

• To modify the current defaults for an unspecified class used with this command, use either set userclass or set vendorclass.


Examples
In the first example, this command sets the value of option code 003 to list two router IP addresses (10.1.1.1, 10.1.1.2).

In the second example, this command sets the value that is specified in the first example to apply only to those scope clients that identify themselves as members of the vendor class Vendor1, a class that was previously defined at the server with this specified option type defined for its use.

set optionvalue 003 IPADDRESS 10.1.1.1 10.1.1.2

set optionvalue 003 IPADDRESS vendor=Vendor1 10.1.1.1 10.1.1.2

Top of page
set reservedoptionvalue
Sets the value of an option for a reservation IP address in the current scope.

Syntax
set reservedoptionvalueReservedIPOptCode {BYTE | WORD | DWORD | STRING | IPADDRESS} [user=UserName] [vendor=VendorName] OptValue

Parameters
ReservedIP
Required. Specifies the reserved IP address for which the option value is to be set.
OptCode
Required. Specifies the code for the option type whose value is to be set.
{BYTE | WORD | DWORD | STRING | IPADDRESS}
Required. Specifies the data type for the option type whose value is to be set.
user=UserName
Specifies either the current default user class or the class specified as UserName. If the tag is provided, but no value is specified, the current default user class is assumed.
vendor=VendorName
Specifies either the current default vendor class or the class specified as VendorName. If the tag is provided, but no value is specified, the current default vendor class is assumed.
OptValue
Required. Specifies the assigned value for the option type specified in OptCode. If the option type supports an array that contains more than a single numeric or IP address value, provide the additional values, in the order that you prefer them, at the end of the command with each value separated by a space.
Remarks
• Vendor and user classes are only supported for DHCP servers running Windows 2000 Server.

• To modify the current defaults for an unspecified class used with this command, use either set userclass or set vendorclass.


Examples
In the following example, this command sets the value of the router option (code 003) for the reserved client IP address of 10.1.1.50 in the current scope to set IP addresses of 10.1.1.1 and 10.1.1.2 for its configured routers (default gateways).

set reservedoptionvalue 10.1.1.50 003 IPADDRESS 10.1.1.1 10.1.1.2

Top of page
set scope
Sets the scope for use in subsequent operations.

Syntax
set scopeScopeAddress

Parameters
ScopeAddress
Required. Specifies the IP address of the scope to use in subsequent command operations.
Examples
In the following example, this command sets the current scope to 10.2.2.0 for subsequent operations.

set scope 10.2.2.0

Top of page
set state
Sets or resets the state of the current scope to either the active or inactive state. Used without parameters, this command activates the scope.

Syntax
set state [{0 | 1 | 2 | 3}]

Parameters
{0 | 1 | 2 | 3}
Indicates the state of the scope: 0-Deactivates the scope, 1-Activates the scope (default), 2-Deactivates the scope and marks the scope as "Switched," 3-Activates the scope and marks the scope as "Switched."
Remarks
• 2 and 3 are typically used for switched networks or networks where multiple logical networks are hosted on a single physical network.


Examples
In the first example, this command activates a scope.

In the second example, this command deactivates a scope.

set state 1

set state 0

Top of page
set superscope
Sets the superscope to use in subsequent operations.

Syntax
set superscopeSuperscopeName {0 | 1}

Parameters
SuperscopeName
Required. Specifies the name of the superscope to include the current scope. The SuperscopeName is case-sensitive.
{0 | 1}
Required. Indicates whether to set the state of the superscope to active or inactive: 0-Deactivates the superscope, 1-Activates the superscope.
Examples
In the following example, this command adds the current scope to the superscope MySuperScope and activates the superscope.

set superscope MySuperScope 1

Top of page
show clients
Displays all of the available version 4 clients for the current scope. Used without parameters, this command displays the following information for each client: IP address, subnet mask, unique ID, lease expiration, and type.

Syntax
show clients[{0 | 1}]

Parameters
{0 | 1}
Indicates the detail level of the output: 0-Shows the following information for each client: IP address, subnet mask, unique ID, lease expiration, and data type (default), 1-Shows all of the information that 0 provides and also displays the fully qualified domain name of each client.
Remarks
• To view the output of this command effectively, increase the width of the command prompt window to at least 95 characters.


Top of page
show clientsv5
Displays all of the available version 5 clients for the current scope. Used without parameters, this command displays the following information for each client: IP address, subnet mask, unique ID, lease expiration, and type.

Syntax
show clientsv5[{0 | 1}]

Parameters
{0 | 1}
Indicates the detail level of the output: 0-Shows the following information for each client: IP address, subnet mask, unique ID, lease expires, type (default), 1-Shows all of the information that 0 provides and also displays the fully qualified domain name of each client.
Remarks
• To view the output of this command effectively, increase the width of the command prompt window to at least 95 characters.


Top of page
show excluderange
Displays all of the currently set exclusion ranges of IP addresses for the current scope.

Syntax
show excluderange

Parameters
none

Remarks
• Use other scope-level commands to add and delete exclusion ranges.


Top of page
show iprange
Displays all of the address ranges that are available for the current scope.

Syntax
show iprange

Parameters
none

Top of page
show optionvalue
Displays all of the option values that are set for the current scope. Used without parameters, this command assumes the current default user and vendor classes.

Syntax
show optionvalue[user=UserName] [vendor=VendorName]

Parameters
user=UserName
Specifies that the options that are set for the specified user class will display. If the tag is provided, but no value is specified, the current default user class is assumed.
vendor=VendorName
Specifies that the options that are set for the specified vendor class will display. If the tag is provided, but no value is specified, the current default vendor class is assumed.
Remarks
• Vendor and user classes are only supported for DHCP servers running Windows 2000 Server.

• To modify the current defaults for an unspecified class used with this command, use either set userclass or set vendorclass.


Examples
In the following example, this command displays all options and values set for the current scope for the user defined class My User Class.

show optionvalue user="My User Class"

Top of page
show reservedip
Displays all of the IP addresses that are currently reserved for the current scope.

Syntax
show reservedip

Parameters
none

Top of page
show reservedoptionvalue
Displays all currently set option values for a reserved client IP address in the current scope.

Syntax
show reservedoptionvalueReservedIP[user=UserName] [vendor=VendorName]

Parameters
ReservedIP
Required. Specifies the IP address reservation for which currently assigned options are to display.
user=UserName
Specifies that the options that are set for the specified user class will display. If the tag is provided, but no value is specified, the current default user class is assumed.
vendor=VendorName
Specifies that the options that are set for the specified vendor class will display. If the tag is provided, but no value is specified, the current default vendor class is assumed.
Remarks
• Vendor and user classes are only supported for DHCP servers running Windows 2000 Server.

• To modify the current defaults for an unspecified class used with this command, use either set userclass or set vendorclass.


Examples
In the following example, this command displays the option values set for the reserved IP address 10.2.2.100 in the current scope.

show reservedoptionvalue 10.2.2.100

Top of page
show scope
Displays information for the current scope.

Syntax
show scope

Parameters
none

Top of page
show state
Displays the state of the current scope, indicating whether it is active or inactive.

Syntax
show state

Parameters
none

Top of page
Top of page
Netsh DHCP server mscope
The following commands can run from the dhcp server mscope> prompt, which is rooted within the netsh environment.

To view the command syntax, click a command:

• add excluderange

• add iprange

• delete excluderange

• delete iprange

• dump

• initiate reconcile

• set comment

• set lease

• set mscope

• set name

• set state

• set ttl

• show clients

• show excluderange

• show iprange

• show lease

• show mibinfo

• show mscope

• show state

• show ttl


add excluderange
Adds a range of excluded addresses to the current multicast scope.

Syntax
add excluderangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the exclusion range.
EndIP
Required. Specifies the IP address that ends the exclusion range.
Remarks
• The exclusion range must be a subset of the overall scope address range.


Examples
In the following example, this command adds an exclusion range that starts with 224.2.2.10 and ends with 224.2.2.20 to the distribution range of the current multicast scope.

add excluderange 224.2.2.10 224.2.2.20

Top of page
add iprange
Adds a range of IP addresses to the current multicast scope.

Syntax
add iprangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the range.
EndIP
Required. Specifies the IP address that ends the range.
Remarks
• The range must be within the valid range of multicast IP addresses (from 224.0.0.0 to 239.255.255.255).


Examples
In the following example, this command adds the IP address range 224.2.2.10 to 224.2.2.20 to the distribution range in the multicast scope.

add iprange 224.2.2.10 224.2.2.20

Top of page
delete excluderange
Deletes an exclusion range of previously excluded IP addresses in the current multicast scope.

Syntax
delete excluderangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the exclusion range.
EndIP
Required. Specifies the IP address that ends the exclusion range.
Examples
In the following example, this command removes a multicast scope exclusion with a range of IP addresses that starts at 224.2.2.10 and ends with 224.2.2.20 for the multicast scope.

delete excluderange 224.2.2.10 224.2.2.20

Top of page
delete iprange
Deletes a range of IP addresses from the current multicast scope.

Syntax
delete iprangeStartIPEndIP

Parameters
StartIP
Required. Specifies the IP address that starts the range to delete.
EndIP
Required. Specifies the IP address that ends the range to delete.
Examples
In the following example, this command deletes the IP address range 224.2.2.10 to 224.2.2.20 from the overall range of the full multicast scope.

delete iprange 224.2.2.10 224.2.2.20

Top of page
dump
Dumps the configuration of the current multicast scope to the command prompt window when run within the netsh environment.

Syntax
dump

When run at the command prompt or in a batch file, output can be saved in a text file. Used without parameters, this command dumps the configuration of the current multicast scope to the command prompt window.

Syntax
netsh dhcp server [ServerName | IPAddress] mscope MscopeID dump >[PathAndFileName]

Parameters
ServerName | IPAddress
Specifies the server name or IP address of the DHCP server for which the scope configuration is output.
MscopeID
Required. Specifies the name of the multicast scope for which the configuration is output.
PathAndFileName
Specifies both the location where the file is saved, and the name of the destination file to which to dump the multicast scope configuration. If unspecified, scope configuration is dumped to the command prompt window.
Examples
The first command, which is run within the netsh environment, dumps the configuration of the current multicast scope to the command prompt window.

The second command, which is run from the command prompt, dumps the configuration of the local server multicast scope TestMscope to the file Mscopecfg.dmp on the shared network folder \\Backup\Dhcp\.

dump

netsh dhcp server mscope TestMscope dump >\\Backup\Dhcp\Mscopecfg.dmp

Top of page
initiate reconcile
Checks and reconciles the current multicast scope.

Syntax
initiate reconcile

Parameters
none

Remarks
• This command checks the integrity of the current multicast scope by comparing the current contents of the server database with a mirrored copy of the same information in the Windows registry. If inconsistencies are detected in the database, they are repaired based on the information that is duplicated in the registry. Repair is always attempted for any inconsistency that is found.


Top of page
set comment
Sets the comment for the current multicast scope.

Syntax
set commentNewComment

Parameters
NewComment
Required. Specifies the new or revised comment for the multicast scope
Examples
In the first example, this command modifies the multicast scope comment with a new comment that contains no spaces.

In the second example, this command modifies the multicast scope comment with a new comment that contains spaces.

set comment NewCommentNoSpaces

set comment "New Comment With Spaces"

Top of page
set lease
Sets the lease duration for the multicast scope IP addresses.

Syntax
set leaseTime

Parameters
Time
Required. Specifies the lease duration for clients of the multicast scope. Specifying -1 sets the duration of the IP address lease to an unlimited or infinite time.
Examples
In the following example, this command sets the lease duration for the clients of the current multicast scope to 691200 seconds (eight days).

set lease 691200

Top of page
set mscope
Sets the multicast scope to use in subsequent operations.

Syntax
set mscopeNewName

Parameters
NewName
Required. Specifies the name of the multicast scope to which the command context is changed. NewName is case-sensitive.
Remarks
• This command changes the context of the netsh dhcp server mscope> prompt from one multicast scope to another.

• This command does not rename the current multicast scope. To change the name of the current multicast scope, use the command set name.


Examples
In the first example, this command changes the command context to a multicast scope named MyMulticastScope. Note that the multicast scope name contains no spaces.

In the second example, this command changes the command context to a multicast scope named My Multicast Scope. Note that the multicast scope name contains spaces.

set mscope MyMulticastScope

set mscope "My Multicast Scope"

Top of page
set name
Changes the name of the current multicast scope.

Syntax
set nameNewName

Parameters
NewName
Required. Specifies a new name for the current multicast scope.
Examples
In the first example, this command sets a new name that contains no spaces for the current multicast scope.

In the second example, this command sets a new name that contains spaces for the current multicast scope.

set name NewNameNoSpaces

set name "New Name With Spaces"

Top of page
set state
Sets or resets the state of the current multicast scope to either an active or inactive state.

Syntax
set state {0 | 1}

Parameters
{0 | 1}
Required. Sets the state of the current multicast scope: 0-Deactivates the current multicast scope, 1-Activates the current multicast scope .
Examples
In the first example, this command activates the current multicast scope.

In the second example, this command deactivates the current multicast scope.

set state 1

set state 0

Top of page
set ttl
Sets the Time-To-Live (TTL) value for the current multicast scope.

Syntax
set ttlTTL

Parameters
TTL
Required. Specifies the Time-to-Live (TTL) value. The valid range for this value is a number from 1 to 255.
Examples
In the following example, this command sets the TTL value for the current multicast scope to 32.

set ttl 32

Top of page
show clients
Displays all available clients for the current multicast scope.

Syntax
show clients

Parameters
none

Remarks
• To view the output of this command effectively, increase the width of the command prompt window to at least 95 characters.


Top of page
show excluderange
Displays all currently excluded ranges of IP addresses for the current multicast scope.

Syntax
show excluderange

Parameters
none

Remarks
• If no exclusion ranges have been previously defined for the scope, this command outputs an empty list.


Top of page
show iprange
Displays all available IP address ranges for the current multicast scope.

Syntax
show iprange

Parameters
none

Top of page
show lease
Displays the current lease duration settings for the current multicast scope.

Syntax
show lease

Parameters
none

Top of page
show mibinfo
Displays management information base (MIB) information for the current multicast scope.

Syntax
show mibinfo

Parameters
none

Top of page
show mscope
Displays information for the current multicast scope.

Syntax
show mscope

Parameters
none

Top of page
show state
Displays the state of the current multicast scope.

Syntax
show state

Parameters
none

Top of page
show ttl
Displays the Time-To-Live (TTL) value for the current multicast scope.

Syntax
show ttl

Parameters
none

How to use FireWire target disk mode

How to use FireWire target disk mode
Important: Unplug all other FireWire devices from both computers prior to using FireWire target disk mode. Do not plug in any FireWire devices until after you have disconnected the two computers from each other, or have stopped using target disk mode.

Tip: If you will be transferring FileVault-protected home directories (Mac OS X 10.3 or later only), log in as the FileVault-protected user and temporarily turn off FileVault. After transferring home directory contents to the target computer, enable FileVault protection again if desired.

To use FireWire target disk mode
Make sure that the target computer is turned off. If you are using a PowerBook or iBook as the target computer, you should also plug in its AC power adapter.
Use a FireWire cable (6-pin to 6-pin) to connect the target computer to a host computer. The host computer does not need to be turned off.
Start up the target computer and immediately press and hold down the T key until the FireWire icon appears. The hard disk of the target computer should become available to the host computer and will likely appear on desktop. (If the target computer is running Mac OS X 10.4 Tiger, you can also open System Preferences, choose Startup Disk, and click Target Disk Mode. Then restart the computer and it will start up in Target Disk Mode.)
When you are finished copying files, drag the target computer's hard disk icon to the Trash or select Put Away from the File menu (Mac OS 9) or Eject from the File menu (Mac OS X).
Press the target computer's power button to turn it off.
Unplug the FireWire cable.
If the target computer's hard disk does not become available to the host computer, check the cable connections and restart the host computer.

Find out about "FireWire Ports and Specifications".

Tip: FireWire Target Disk Mode works on internal ATA drives only. Target Disk Mode only connects to the master ATA drive on the Ultra ATA bus. It will not connect to Slave ATA, ATAPI or SCSI drives.

Using Target Disk Mode with Intel-based Macs
If you attempt to mount an Intel-based Mac in Target Disk Mode on a Macintosh running Mac OS X 10.3.9 or earlier, you'll see an alert message. For more information, see article 303118, "Intel-based Macs: "You have inserted a disk containing no volumes that Mac OS X can read" alert message".

C Shell commmands

The C shell provides the following built-in commands:

# Marks a command.
alias Displays alias.
bg Resumes job in the background.
break Resumes execution after the loop.
breaksw Breaks from a switch command; resumes after the endsw command.
case Defines a label in a switch command.
cd Changes directory.
chdir Changes directory, same as cd.
continue Continues a loop.
default Specifies the default case in a switch.
dirs Displays the directory stack.
echo Writes arguments to the standard output of the shell.
eval Evaluates a command.
exec Executes the command in the current shell.
exit Exits the shell.
fg Brings a job in the foreground.
foreach Specifies a looping control statement and execute a sequence of commands until reaching an end command.
glob Writes arguments to the standard output of the shell, like the echo command, but without the new line.
goto Continues execution after the specified label.
hashstat Displays hash table statistics.
history Displays the history list.
if Executes a command if condition met.
jobs Lists active jobs.
kill Sends a signal to a process. term (terminate) is the default signal.
limit
Sets or list system resource limits.
login Logs on.
logout Logs out.
nice Changes the priority of commands run in the shell.
nohup Ignores the hangup signal.
notify
Notifies the user about changes in job status.
onintr Tells the shell what to do on interrupt.
popd Pops the top directory off the directory stack and changes to the new top directory.
pushd Exchanges the top two elements of the directory stack.
rehash Re-computes the hash table of the contents of the directories in the path shell variable.
repeat
Repeats the execution of a command.
set Displays or set the value of a shell variable.
setenv Sets environment variables.
shift Shifts shell arguments.
source Reads commands from a script.
stop
Stops a background job.
suspend Stops the current shell.
switch Starts a switch.
time Displays the time used to execute commands.
umask Shows or set file permissions.
unalias
Removes command alias.
unhash Disables the internal hash table.
unlimit Removes limitations on system Resource.
unset Deletes shell variables.
unsetenv Deletes environment variables.
wait Waits for background jobs to complete.
while …end
Executes the commands between the while and matching end statements repeatedly.
@ Displays or set the values of all the shell variables.




The Linux/Unix shell refers to a special program that allows you to interact with it by entering certain commands from the keyboard; the shell will execute the commands and display its output on the monitor. The environment of interaction is text-based (unlike the GUI-based interaction we have been using in the previous chapters) and since it is command-oriented this type of interface is termed Command Line interface or CLI. Before the advent of GUI-based computing environments, the CLI was the only way that one can interact and access a computer system.

Up until now, there was never a need to type commands into a shell; and with the modernisation and creation of a lot of newer GUI-based tools, the shell is becoming increasingly un-required to perform many tasks. But that said, the shell is a very powerful place, and a lot is achieved through it.

Sponsored Links
Linux TutorialGet the latest news, white papers, discussion threads, and much more.Linux.ITtoolbox.com

Amanda Backup SoftwareOpen Source Data Protection Simple, Secure, Enterprise Readywww.zmanda.com

Free RAD tool for LinuxDevelop Desktop application rapidly No knowledge of C++, Java requiredwww.go-db.com/godb_linux.asp

A lot of the front-end GUI methods of doing things have similar ways and means to get done with using the shell. Professional Linux and UNIX users find the shell very powerful, and an introduction to at least the basic shell usage is useful.--

Linux init ("ASCII art")

Linux init ("ASCII art")









Pictorially (loosely speaking :), Linux initialization looks like
this, where "[...]" means optional (depends on the kernel's
configuration) and "{...}" is a comment.











+-------------------------------+ | arch/i386/boot/setup.S:: + | | arch/i386/boot/video.S:: | |-------------------------------| | start_of_setup: | | check that loaded OK | | get system memory size | | get video mode(s) | | get hard disk parameters | | get MC bus information | | get mouse information | | get APM BIOS information | | enable address line A20 | | reset coprocessor | | mask all interrupts | | move to protected mode | | jmp to startup_32 | +-------------------------------+ | v +-------------------------------+ | arch/i386/kernel/head.S:: | |-------------------------------| | startup_32: | | set segment registers to | | known values | | init basic page tables | | setup the stack pointer | | clear kernel BSS | | setup the IDT | | checkCPUtype | | load GDT, IDT, and LDT | | pointer registers | | start_kernel | | {it does not return} | +-------------------------------+ | v +-------------------------------+ +-------------------------------+ | init/main.c:: | +->| arch/i386/kernel/setup.c:: | |-------------------------------| | |-------------------------------| | start_kernel(): | | | setup_arch(): | | lock_kernel | | | copy boot parameters | | setup_arch |--+ | init ramdisk | | parse_options |<-+ | setup_memory_region | | trap_init | | | parse_cmd_line | | cpu_init | | | use the BIOS memory map to | | init_IRQ | | | setup page frame info. | | sched_init | | | reserve physical page 0 | | init_timervecs | | | [find_smp_config] | | time_init | | | paging_init | | softirq_init | | | [get_smp_config] | | console_init | | | [init_apic_mappings] | | [init_modules] | | | [reserve INITRD memory] | | [profiling setup] | | | probe_roms to search | | kmem_cache_init | | | for option ROMs | | sti | | | request_resource to | | calibrate_delay | | | reserve video RAM memory | | [INITRD setup] | | | request_resource to | | mem_init | | | reserve all standard PC | | free_all_bootmem | +--| I/O system board resources| | kmem_cache_sizes_init | +-------------------------------+ | [proc_root_init] | | fork_init | | proc_caches_init | | vfs_caches_init | | buffer_init | | page_cache_init | | kiobuf_setup | | signals_init | +-------------------------------+ | bdev_init | | init/main.c:: | | inode_init | | init(): {...init thread...} | | [ipc_init] | | do_basic_setup | | [dquot_init_hash] | | {bus/dev init & initcalls}| | check_bugs | | free_initmem | | [smp_init] {*below} | | open /dev/console | | start init thread {---->} |.....| exec init script or shell | | unlock_kernel | | or panic | | cpu_idle | +-------------------------------+ +-------------------------------+ +-------------------------------+ | smpboot.c::smp_init | |-------------------------------| | arch/i386/kernel/smpboot.c:: | | smp_boot_cpus(): | | [mtrr_init_boot_cpu] | | smp_store_cpu_info | | print_cpu_info | | save CPU ID/APIC ID mappings| | verify_local_APIC | | connect_bsp_APIC | | setup_local_APIC | | foreach valid APIC ID | | do_boot_cpu(apicid) | | setup_IO_APIC | | setup_APIC_clocks | | synchronize_tsc_bp | +-------------------------------+

Reliance LG LSP 340 Series WLL Modem Setup HOWTO

1. Introduction
This HOWTO is for people who have Reliance or TATA Indicomm WLL phones and wish to access Internet on their desktops/laptops running GNU/Linux using serial cable (NOT a USB CABLE).
No software provided by Reliance was used, but I did search the Internet for the modem query strings which are required during PPP setup.
I have tried this setup on Slackware Linux 10.1 with a 2.4.29 kernel and I am pretty confident that this trick will work on other Linux distributions as well.
The HOWTO assumes that you have a fair knowledge about your Linux distribution (BSD or System V style) and that PPP support is pre-compiled in your Linux kernel.
In this HOWTO we are talking about the serial cable for the following reasons:
The cable provided by Reliance or TATA is very expensive (about 1400 rupees) and the software provided supports only MS Windows.The cable typically has a USB interface on one end and an RJ-45 interface on the other. However, for these phones phones a cheaper cable is available on the market (only 100 rupees). This cable has a serial interface on one end and an RJ-45 on the other. You can make this cable yourself. The procedure is discussed later in this HOWTO. Why waste money when you can assemble your own cable or purchase the cheaper one?
USB cables have some glitches for the WLL handsets, especially the LG ones. I have no idea about other handsets, your input is welcome if you know about other sets. The advantage in using a USB cable is that you can connect at 153.6 kbps as the handsets have an inbuilt modem which is capable for speeds upto 170kbps.
On the numerous forums I searched on the net I found that all talked only about the USB cable and not about the serial one. I thought it was high time to write this HOWTO to help fellow Linux users.
But I have a USB cable!

If you have the USB cable after all, visit http://www.hackgnu.org/ril-howto.html for information about setting up Internet access using LG/SAMSUNG CDMA sets.
This link is also helpful: http://www.linuxsolved.com/forums/ftopic1178.html
Unfortunately the LG/SAMSUNG CDMA mobile uses USB cables only, but the good news is that these USB cables are also available on the market. Purchase them at your local computer vendor's. As per my last information such cables cost only 200 rupees.
2. System Requirements
You will need a GNU/Linux system with a kernel having PPP support pre-compiled. I have tested that both the 2.4.29 kernel and the 2.6.x series kernel work fine. Performance seems to be better using a 2.6.x kernel. If you see that some kernel modules are missing then configure and recompile the kernel with PPP support.
Check with Section 4 for the configuration of PPP.
A connecting serial cable which has on one end an RJ-45 connector which plugs into the phone and on the other end has an RS-232 serial connector which is plugged into the serial port of the PC.
I built my cable myself. I used a CAT 5 cable which has four pairs of UTP copper. CAT 5 cable is the same cable which is used for networking your system to a LAN. While you can use any type of cable, CAT 5 will assure a good quality of the signal that is sent over the wire. A typical configuration looks like this:
RS-232C Serial Female connector, which is plugged into the PC:
___________________
\ /
\ 5 4 3 2 1 /
\ 9 8 7 6 /
\___________/

Now let's start with the PIN Configuration
PIN 1 - White Brown cable
PIN 2 - Blue cable
PIN 3 - White Green cable
PIN 4 - Green cable
PIN 5 - White Blue cable
PIN 6 - Brown cable
PIN 7 - White Orange cable
PIN 8 - Orange cable
PIN 9 - Leave empty (we are only using 8 pins)
Serial connection details

Three strings would be enough for a serial connection, but it turned out that the signal is better when you use 5. The other strings are used for extra rigidness and support of the cable.
Now on to the RJ-45 connector, which is plugged into the WLL Phone RJ-45 jack:
[8 7 6 5 4 3 2 1]
----
-
1 - White Orange
2 - Orange
3 - White Green
4 - Blue
5 - White Blue
6 - Green
7 - White Brown
8 - Brown
How to hold the connector

If you are confused as to which way to hold the connector, make sure that you are holding the connector in such a way that its notch pin is facing towards the floor and that the open portion (portion from where the wires enter) is facing away from you.
3. Activating Internet Services on your Handset
To get Internet services activated on your handset you may contact the customer care center of your service provider. In the case of the Reliance the service is pre-activated.
For establishing the connection on a Reliance, the user name is the phone number without the prefix 0 in the STD code. For instance, if your STD code is 0124 and telephone number is 3456789 then your user name is 1243456789. Your password is the same as your user name. When using the TATA Indicomm user name and password are "internet" (without quotes).
4. Checking for PPP Support
Although PPP support is provided in almost all Linux distributions but it is still better to check whether it is present on your system. You can use checkconfig or, better still, look into the /usr/sbin directory and locate PPP binaries with the command
ls -al ppp*
If you get a listing like this:
-rwxr-xr-x 1 root root 3438 2005-05-28 14:56 ppp-go*
-rwxr-xr-x 1 root bin 1787 2004-02-26 21:36 ppp-off*
lrwxrwxrwx 1 root root 6 2005-05-28 14:17 ppp-on -> ppp-go*
lrwxrwxrwx 1 root root 7 2005-05-28 14:17 ppp-stop -> ppp-off*
-rwxr-xr-x 1 root bin 346812 2004-02-26 21:36 pppd*
-rwxr-xr-x 1 root bin 37916 2004-02-26 21:36 pppdump*
-rwxr-xr-x 1 root bin 25936 2003-03-02 22:05 pppoe*
-rwxr-xr-x 1 root bin 22308 2003-03-02 22:05 pppoe-relay*
-rwxr-xr-x 1 root bin 35084 2003-03-02 22:05 pppoe-server*
-rwxr-xr-x 1 root bin 12028 2003-03-02 22:05 pppoe-sniff*
-rwxr-xr-x 1 root bin 58527 2004-02-26 21:36 pppsetup*
-rwxr-xr-x 1 root bin 9192 2004-02-26 21:36 pppstats*
then PPP support is definitely present.
Similarly, look into /etc/ppp directory, which contains the PPP options file and some other files configuring PPP:
-rw------- 1 root root 78 2004-02-26 21:36 chap-secrets
-rw------- 1 root root 1625 2005-05-28 14:35 connect-errors
-rw-r--r-- 1 root root 938 2003-03-02 22:04 firewall-masq
-rw-r--r-- 1 root root 836 2003-03-02 22:04 firewall-standalone
-rwxr-xr-x 1 root root 1208 2005-05-28 14:56 ip-down*
-rwxr-xr-x 1 root root 1208 2005-05-28 14:29 ip-down.OLD*
-rwxr-xr-x 1 root root 1945 2005-05-28 14:56 ip-up*
-rwxr-xr-x 1 root root 1945 2005-05-28 14:29 ip-up.OLD*
-rw------- 1 root root 541 2005-05-28 14:58 options
-rw------- 1 root root 656 2005-05-28 14:56 options.demand
-rw-r--r-- 1 root root 9975 2005-05-28 11:21 options.old
-rw------- 1 root root 216 2005-05-28 14:56 pap-secrets
drwxr-xr-x 2 root root 4096 2003-03-02 22:05 plugins/
-rw-r--r-- 1 root root 104 2003-03-02 22:04 pppoe-server-options
-rw-r--r-- 1 root root 4562 2003-03-02 22:04 pppoe.conf
-rw------- 1 root root 129 2005-05-28 15:12 pppscript
-rw------- 1 root root 8941 2005-05-28 14:56 pppsetup.txt
For the sake of safety do copy your original options file to a file options.old so that you can revert back to your original setup should you have troubles.
See the PPP HOWTO Chapter 10 for more information on PPP support in the Linux kernel.
5. Configuring your Phone
Currently Reliance comes with one of two brands of handsets: LG and Samsung. TATA Indicom also provides two handsets: LG and AXESSTEL.
Plug the cable to the phone and also to the system.
It is important to note that all these phones act as a serial modem so they do not require a driver or anything. After you have connected your phone to the cable, the cable is plugged in either COM1 or COM2 (and not COM3 or COM4, as these are virtual ports).
Remember:
COM1 in LINUX is /dev/ttyS0
COM2 is LINUX is /dev/ttyS1
Your phone modem works on either of the two ports, but I suggest that first try /dev/ttyS1, so as not to disturb other peripherics on your system that are also using a serial port, which would then usually be on /dev/ttyS0.
First check if your COM port is fine using the command
setserial /dev/ttyS1 -a
If it displays something like this:
dev/ttyS1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 3
Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal skip_test

then your COM port is fine. If this does not work, it is possible that PPP support is not configured after all. Return to Section 4 to check. If you are sure that PPP support is configured on your system, maybe the problem is with the COM port. You could try the other port in that case.
Now go to the shell and type
cat /dev/ttyS1
If this prints nothing, your phone is configured. Type CTRL+C to exit.
If your modem is not configured, the cat command would give an error message like this:
cat: /dev/ttyS1: No such device
Alternately, in case you use KDE, start the KPPP program: go to the desktop and press Alt+F2 and type "kppp" in the box which appears. This will start KPPP.
Testing using KPPP:
Click on the Configure button. Go to the Modem tab.There add a new modem on /dev/ttyS1and click OK. Now select the newly created modem and click the EDITbutton. In the new box which appears, select Modemand then click Query modem. If the modem is properly set then you will get the proper status of the modem. It will first say something like "Finding Modem", then some more messages.
Lock file

BE SURE TO UNCHECK THE USE LOCK FILE CHECKBOX in the modem properties, else it may give some random errors.
If all is fine you will be presented with a window with some blank textboxes and you can go ahead.
6. PPP Configuration
Make an easy link to your modem device:
ln -s /dev/ttyS1 /dev/modem
Now change to the /usr/sbin directory and look for ppp files. Look for either a pppsetup or a pppconfig script. You may directly start this script to set up PPP on your system. On my Slackware system I typed pppsetup and started the script. This script asks for various parameters for connecting via the ISP.
It first asks for the phone number to dial -- enter "atdt#777", where 777 is replaced by the number that you need to dial.
It then asks for the modem -- select /dev/ttyS1
Baud Rate -- select "115200"
Callback -- Answer "NO"
Modem INIT String -- "ATZ OK "at+crm=1" OK"
ISP Domain Name -- Leave blank
DNS Server Address -- Enter a valid DNS Server IP, for instance "202.41.97.3" or "202.41.97.132", or leave blank
Authentication -- "PAP"
Username
Password
Refer to Section 3 for Username and Password.
Finally it shows you your configuration.
Some more work needs to be done. We need to edit the options file present in the /etc/ppp folder. We need to check if the following entries are present in the file:
lock
defaultroute
noipdefault
modem
/dev/ttyS1
115200
crtscts
noauth
passive
asyncmap 0
The noauth option

Remember that noauth is by default commented; you need to uncomment it.
You can use egrep -v '#^ *$' /etc/ppp/options to list only the options present in this file so as to quickly judge which ones are missing or incorrect.
7. Let's Get Started
For testing purposes log in as root and open two different shells.
In one shell issue the command
tail -f /var/log/messages
Start the PPP connection in the other shell using the command
ppp-on
In the first shell you will see various messages indicating that the modem is initialized and that the connection is being established. My /var/log/messages looks like this:
May 29 06:14:06 dhiraj pppd[2341]: pppd 2.4.2 started by root, uid 0
May 29 06:14:07 dhiraj chat[2343]: timeout set to 60 seconds
May 29 06:14:07 dhiraj chat[2343]: abort on (ERROR)
May 29 06:14:07 dhiraj chat[2343]: abort on (BUSY)
May 29 06:14:07 dhiraj chat[2343]: abort on (NO CARRIER)
May 29 06:14:07 dhiraj chat[2343]: abort on (NO DIALTONE)
May 29 06:14:07 dhiraj chat[2343]: send (ATZ^M)
May 29 06:14:07 dhiraj chat[2343]: expect (OK)
May 29 06:14:07 dhiraj chat[2343]: ATZ^M^M
May 29 06:14:07 dhiraj chat[2343]: OK
May 29 06:14:07 dhiraj chat[2343]: -- got it
May 29 06:14:07 dhiraj chat[2343]: send (at+crm=1^M)
May 29 06:14:07 dhiraj chat[2343]: expect (OK)
May 29 06:14:07 dhiraj chat[2343]: ^M
May 29 06:14:07 dhiraj chat[2343]: at+crm=1^M^M
May 29 06:14:07 dhiraj chat[2343]: OK
May 29 06:14:07 dhiraj chat[2343]: -- got it
May 29 06:14:07 dhiraj chat[2343]: send (atdt#777^M)
May 29 06:14:07 dhiraj chat[2343]: timeout set to 75 seconds
May 29 06:14:07 dhiraj chat[2343]: expect (CONNECT)
May 29 06:14:07 dhiraj chat[2343]: ^M
May 29 06:14:07 dhiraj chat[2343]: atdt#777^M^M
May 29 06:14:07 dhiraj chat[2343]: CONNECT
May 29 06:14:07 dhiraj chat[2343]: -- got it
May 29 06:14:07 dhiraj pppd[2341]: Serial connection established.
May 29 06:14:07 dhiraj pppd[2341]: Using interface ppp0
May 29 06:14:07 dhiraj pppd[2341]: Connect: ppp0 <--> /dev/ttyS1
May 29 06:14:13 dhiraj pppd[2341]: PAP authentication succeeded
May 29 06:14:13 dhiraj kernel: PPP BSD Compression module registered
May 29 06:14:13 dhiraj kernel: PPP Deflate Compression module registered
May 29 06:14:14 dhiraj pppd[2341]: local IP address 220.224.45.140
May 29 06:14:14 dhiraj pppd[2341]: remote IP address 97.235.2.5
Now open your browser and get started.
In case the browser gives the error that the server name is not being resolved, open the file /etc/resolve.conf and add the entry
namesserver 202.41.97.9
nameserver 202.41.97.132

These are two valid DNS servers of Ernet India Labs, located in New Delhi. Your Internet Service Provider probably provides its own name service, use the IP addresses of the servers they recommend.
When you are finished surfing the net you may stop the connection using
ppp-off
in the second shell. In the other shell window you will get something like this :
May 29 06:16:15 dhiraj pppd[2341]: Terminating on signal 2.
May 29 06:16:15 dhiraj pppd[2341]: Connection terminated.
May 29 06:16:15 dhiraj pppd[2341]: Connect time 2.2 minutes.
May 29 06:16:15 dhiraj pppd[2341]: Sent 3401 bytes, received 1563 bytes.
May 29 06:16:16 dhiraj pppd[2341]: Connect time 2.2 minutes.
May 29 06:16:16 dhiraj pppd[2341]: Sent 3401 bytes, received 1563 bytes.
May 29 06:16:16 dhiraj pppd[2341]: Exit.

Stop the messages output using Ctrl+C.

You might also like :

Related Posts with Thumbnails