English Sentence Loading...
英语句子加载中...

常见网络命令

C:\>ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128

Ping statistics for 127.0.0.1:
     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
     Minimum = 0ms, Maximum =   0ms, Average =   0ms


C:\>ipconfig /all

Windows 2000 IP Configuration

         Host Name . . . . . . . . . . . . : sy32
         Primary DNS Suffix   . . . . . . . :
         Node Type . . . . . . . . . . . . : Broadcast
         IP Routing Enabled. . . . . . . . : No
         WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter 本地连接 2:

         Connection-specific DNS Suffix   . :
         Description . . . . . . . . . . . : Alpha AFL8139D 10/100 Fast Ethernet Adapter(A3+)
         Physical Address. . . . . . . . . : 00-E0-4C-B5-40-AF
         DHCP Enabled. . . . . . . . . . . : No
         IP Address. . . . . . . . . . . . : 172.10.3.2
         Subnet Mask . . . . . . . . . . . : 255.255.0.0
         Default Gateway . . . . . . . . . :
         DNS Servers . . . . . . . . . . . :

Ethernet adapter 本地连接:

         Connection-specific DNS Suffix   . :
         Description . . . . . . . . . . . : Realtek RTL8139(A)-based PCI Fast Ethernet Adapter
         Physical Address. . . . . . . . . : 00-01-6C-8D-C6-B4
         DHCP Enabled. . . . . . . . . . . : No
         IP Address. . . . . . . . . . . . : 192.168.0.32
         Subnet Mask . . . . . . . . . . . : 255.255.255.0
         Default Gateway . . . . . . . . . : 192.168.0.254
         DNS Servers . . . . . . . . . . . :

C:\>arp -a

Interface: 192.168.0.32 on Interface 0x1000004
   Internet Address       Physical Address       Type
   192.168.0.31           00-01-6c-8d-9c-29      dynamic


C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x1000003 ...00 e0 4c b5 40 af ...... PCI/CardBus 10/100 Fast Ethernet Adapter N
DIS5 Driver
0x1000004 ...00 01 6c 8d c6 b4 ...... NDIS 5.0 driver

===========================================================================
===========================================================================
Active Routes:
Network Destination         Netmask           Gateway        Interface   Metric
           0.0.0.0           0.0.0.0     192.168.0.254     192.168.0.32        1
         127.0.0.0         255.0.0.0         127.0.0.1        127.0.0.1        1
        172.10.0.0       255.255.0.0        172.10.3.2       172.10.3.2        1
        172.10.3.2   255.255.255.255         127.0.0.1        127.0.0.1        1
    172.10.255.255   255.255.255.255        172.10.3.2       172.10.3.2        1
       192.168.0.0     255.255.255.0      192.168.0.32     192.168.0.32        1
      192.168.0.32   255.255.255.255         127.0.0.1        127.0.0.1        1
     192.168.0.255   255.255.255.255      192.168.0.32     192.168.0.32        1
         224.0.0.0         224.0.0.0        172.10.3.2       172.10.3.2        1
         224.0.0.0         224.0.0.0      192.168.0.32     192.168.0.32        1
   255.255.255.255   255.255.255.255        172.10.3.2       172.10.3.2        1
Default Gateway:      192.168.0.254
===========================================================================
Persistent Routes:
   None


C:\>ping

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
             [-r count] [-s count] [[-j host-list] | [-k host-list]]
             [-w timeout] destination-list

Options:
     -t              Ping the specified host until stopped.
                    To see statistics and continue - type Control-Break;
                    To stop - type Control-C.
     -a              Resolve addresses to hostnames.
     -n count        Number of echo requests to send.
     -l size         Send buffer size.
     -f              Set Don't Fragment flag in packet.
     -i TTL          Time To Live.
     -v TOS          Type Of Service.
     -r count        Record route for count hops.
     -s count        Timestamp for count hops.
     -j host-list    Loose source route along host-list.
     -k host-list    Strict source route along host-list.
     -w timeout      Timeout in milliseconds to wait for each reply.


C:\>ipconfig /?

Windows 2000 IP Configuration


USAGE:
    ipconfig [/? | /all | /release [adapter] | /renew [adapter]
             | /flushdns | /registerdns
             | /showclassid adapter
             | /setclassid adapter [classidtoset] ]

    adapter     Full name or pattern with '*' and '?' to 'match',
               * matches any character, ? matches one character.
    Options
        /?            Display this help message.
        /all          Display full configuration information.
        /release      Release the IP address for the specified adapter.
        /renew        Renew the IP address for the specified adapter.
        /flushdns     Purges the DNS Resolver cache.
        /registerdns Refreshes all DHCP leases and re-registers DNS names
        /displaydns   Display the contents of the DNS Resolver Cache.
        /showclassid Displays all the dhcp class IDs allowed for adapter.
        /setclassid   Modifies the dhcp class id.

The default is to display only the IP address, subnet mask and
default gateway for each adapter bound to TCP/IP.

For Release and Renew, if no adapter name is specified, then the IP address
leases for all adapters bound to TCP/IP will be released or renewed.

For SetClassID, if no class id is specified, then the classid is removed.

Examples:
     > ipconfig                        ... Show information.
     > ipconfig /all                   ... Show detailed information
     > ipconfig /renew                 ... renew all adapaters
     > ipconfig /renew EL*             ... renew adapters named EL....
     > ipconfig /release *ELINK?21*    ... release all matching adapters,
                                          eg. ELINK-21, myELELINKi21adapter.

C:\>route /?

Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination]
                   [MASK netmask]   [gateway] [METRIC metric]   [IF interface]

   -f            Clears the routing tables of all gateway entries.   If this is
                used in conjunction with one of the commands, the tables are
                cleared prior to running the command.
   -p            When used with the ADD command, makes a route persistent across
                boots of the system. By default, routes are not preserved
                when the system is restarted. Ignored for all other commands,
                which always affect the appropriate persistent routes. This
                option is not supported in Windows 95.
   command       One of these:
                  PRINT      Prints   a route
                  ADD        Adds     a route
                  Delete     Deletes a route
                  CHANGE     Modifies an existing route
   destination   Specifies the host.
   MASK          Specifies that the next parameter is the 'netmask' value.
   netmask       Specifies a subnet mask value for this route entry.
                If not specified, it defaults to 255.255.255.255.
   gateway       Specifies gateway.
   interface     the interface number for the specified route.
   METRIC        specifies the metric, ie. cost for the destination.

All symbolic names used for destination are looked up in the network database
file NETWORKS. The symbolic names for gateway are looked up in the host name
database file HOSTS.

If the command is PRINT or Delete. Destination or gateway can be a wildcard,
(wildcard is specified as a star '*'), or the gateway argument may be omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The '*' matches any string,
and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
     Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
     Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
              The route addition failed: The specified mask parameter is invalid.
(Destination & Mask) != Destination.

Examples:

     > route PRINT
     > route ADD 157.0.0.0 MASK 255.0.0.0   157.55.80.1 METRIC 3 IF 2
              destination^       ^mask       ^gateway      metric^     ^
                                                          Interface^
       If IF is not given, it tries to find the best interface for a given
       gateway.
     > route PRINT
     > route PRINT 157*           .... Only prints those matching 157*
     > route Delete 157.0.0.0
     > route PRINT


C:\>route /?

Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination]
                   [MASK netmask]   [gateway] [METRIC metric]   [IF interface]

   -f            Clears the routing tables of all gateway entries.   If this is
                used in conjunction with one of the commands, the tables are
                cleared prior to running the command.
   -p            When used with the ADD command, makes a route persistent across
                boots of the system. By default, routes are not preserved
                when the system is restarted. Ignored for all other commands,
                which always affect the appropriate persistent routes. This
                option is not supported in Windows 95.
   command       One of these:
                  PRINT      Prints   a route
                  ADD        Adds     a route
                  Delete     Deletes a route
                  CHANGE     Modifies an existing route
   destination   Specifies the host.
   MASK          Specifies that the next parameter is the 'netmask' value.
   netmask       Specifies a subnet mask value for this route entry.
                If not specified, it defaults to 255.255.255.255.
   gateway       Specifies gateway.
   interface     the interface number for the specified route.
   METRIC        specifies the metric, ie. cost for the destination.

All symbolic names used for destination are looked up in the network database
file NETWORKS. The symbolic names for gateway are looked up in the host name
database file HOSTS.

If the command is PRINT or Delete. Destination or gateway can be a wildcard,
(wildcard is specified as a star '*'), or the gateway argument may be omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The '*' matches any string,
and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
     Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
     Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
              The route addition failed: The specified mask parameter is invalid.
(Destination & Mask) != Destination.

Examples:

     > route PRINT
     > route ADD 157.0.0.0 MASK 255.0.0.0   157.55.80.1 METRIC 3 IF 2
              destination^       ^mask       ^gateway      metric^     ^
                                                          Interface^
       If IF is not given, it tries to find the best interface for a given
       gateway.
     > route PRINT
     > route PRINT 157*           .... Only prints those matching 157*
     > route Delete 157.0.0.0
     > route PRINT


C:\>netstat ?

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]

   -a             Displays all connections and listening ports.
   -e             Displays Ethernet statistics. This may be combined with the -s
                 option.
   -n             Displays addresses and port numbers in numerical form.
   -p proto       Shows connections for the protocol specified by proto; proto
                 may be TCP or UDP.   If used with the -s option to display
                 per-protocol statistics, proto may be TCP, UDP, or IP.
   -r             Displays the routing table.
   -s             Displays per-protocol statistics.   By default, statistics are
                 shown for TCP, UDP and IP; the -p option may be used to specify
                 a subset of the default.
   interval       Redisplays selected statistics, pausing interval seconds
                 between each display.   Press CTRL+C to stop redisplaying
                 statistics.   If omitted, netstat will print the current
                 configuration information once.
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 网络 命令
相关日志:
评论: 0 | 引用: 0 | 查看次数: 2564