Monday, October 18, 2010
Cisco IP Addressing Commands
IP Addressing Commands: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
arp (global) arp (interface) arp timeout clear arp-cache clear host clear ip nat translation clear ip nhrp clear ip route ip address ip broadcast-address ip classless ip default-gateway ip directed-broadcast ip domain-list ip domain-lookup ip domain-lookup nsap ip domain-name ip forward-protocol ip forward-protocol any-local-broadcast ip forward-protocol spanning-tree ip forward-protocol turbo-flood ip helper-address ip host ip hp-host ip irdp ip mobile arp ip name-server ip nat ip nat inside destination ip nat inside source ip nat outside source ip nat pool ip nat translation ip netmask-format | ip nhrp authentication ip nhrp holdtime ip nhrp interest ip nhrp map ip nhrp map multicast ip nhrp max-send ip nhrp network-id ip nhrp nhs ip nhrp record ip nhrp responder ip nhrp use ip probe proxy ip proxy-arp ip redirects ip routing ip subnet-zero ip unnumbered ping (privileged) ping (user) show arp show hosts show ip aliases show ip arp show ip interface show ip irdp show ip masks show ip nat statistics show ip nat translations show ip nhrp show ip nhrp traffic show ip redirects term ip netmask-format trace (privileged) trace (user) tunnel mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IP Addressing CommandsThis chapter describes the function and displays the syntax for IP addressing commands. For more information about defaults and usage guidelines, see the corresponding chapter of the Network Protocols Command Reference, Part 1. arp (global)To add a permanent entry in the Address Resolution Protocol (ARP) cache, use the arp global configuration command. To remove an entry from the ARP cache, use the no form of this command. arp ip-address hardware-address type [alias]
arp (interface)To control the interface-specific handling of IP address resolution into 48-bit Ethernet, FDDI, and Token Ring hardware addresses, use the arp interface configuration command. To disable an encapsulation type, use the no form of this command. arp {arpa | probe | snap}
arp timeoutTo configure how long an entry remains in the ARP cache, use the arp timeout interface configuration command. To restore the default value, use the no form of this command. arp timeout seconds
clear arp-cacheTo delete all dynamic entries from the ARP cache, to clear the fast-switching cache, and to clear the IP route cache, use the clear arp-cache EXEC command. clear hostTo delete entries from the host-name-and-address cache, use the clear host EXEC command.
clear ip nat translationTo clear dynamic Network Address Translation (NAT) translations from the translation table, use the clear ip nat translation EXEC command.
clear ip nhrpTo clear all dynamic entries from the Next Hop Resolution Protocol (NHRP) cache, use the clear ip nhrp EXEC command. clear ip routeTo delete routes from the IP routing table, use the clear ip route EXEC command. clear ip route {network [mask] | *}
ip addressTo set a primary or secondary IP address for an interface, use the ip address interface configuration command. To remove an IP address or disable IP processing, use the no form of this command. ip address ip-address mask [secondary]
ip broadcast-addressTo define a broadcast address for an interface, use the ip broadcast-address interface configuration command. To restore the default IP broadcast address, use the no form of this command. ip broadcast-address [ip-address]
ip classlessAt times the router might receive packets destined for a subnet of a network that has no network default route. To have the Cisco IOS software forward such packets to the best supernet route possible, use the ip classless global configuration command. To disable this feature, use the no form of this command. ip default-gatewayTo define a default gateway (router) when IP routing is disabled, use the ip default-gateway global configuration command. To disable this function, use the no form of this command. ip default-gateway ip-address
ip directed-broadcastTo enable the translation of directed broadcast to physical broadcasts, use the ip directed-broadcast interface configuration command. To disable this function, use the no form of this command. ip directed-broadcast [access-list-number]
ip domain-listTo define a list of default domain names to complete unqualified host names, use the ip domain-list global configuration command. To delete a name from a list, use the no form of this command. ip domain-list name
ip domain-lookupTo enable the IP Domain Naming System (DNS)-based host name-to-address translation, use the ip domain-lookup global configuration command. To disable the DNS, use the no form of this command. ip domain-lookup ip domain-lookup nsapTo allow DNS queries for Connectionless Network System (CLNS) addresses, use the ip domain-lookup nsap global configuration command. To disable this feature, use the no form of this command. ip domain-lookup nsap ip domain-nameTo define a default domain name that the Cisco IOS software uses to complete unqualified host names (names without a dotted-decimal domain name), use the ip domain-name global configuration command. To disable use of the DNS, use the no form of this command. ip domain-name name
ip forward-protocolTo specify which protocols and ports the router forwards when forwarding broadcast packets, use the ip forward-protocol global configuration command. To remove a protocol or port, use the no form of this command. ip forward-protocol {udp [port] | nd | sdns}
ip forward-protocol any-local-broadcastTo forward any broadcasts including local subnet broadcasts, use the ip forward-protocol any-local-broadcast global configuration command. To disable this type of forwarding, use the no form of this command. ip forward-protocol any-local-broadcast ip forward-protocol spanning-treeTo permit IP broadcasts to be flooded throughout the internetwork in a controlled fashion, use the ip forward-protocol spanning-tree global configuration command. To disable the flooding of IP broadcasts, use the no form of this command. ip forward-protocol spanning-tree ip forward-protocol turbo-floodTo speed up flooding of User Datagram Protocol (UDP) datagrams using the spanning-tree algorithm, use the ip forward-protocol turbo-flood global configuration command. To disable this feature, use the no form of this command. ip forward-protocol turbo-flood ip helper-addressTo have the Cisco IOS software forward User Datagram Protocol (UDP) broadcasts, including BOOTP, received on an interface, use the ip helper-address interface configuration command. To disable the forwarding of broadcast packets to specific addresses, use the no form of this command. ip helper-address address
ip hostTo define a static host name-to-address mapping in the host cache, use the ip host global configuration command. To remove the name-to-address mapping, use the no form of this command. ip host name [tcp-port-number] address1 [address2...address8]
ip hp-hostTo enter into the host table the host name of an HP host to be used for HP Probe Proxy service, use the ip hp-host global configuration command. To remove a host name, use the no form of this command. ip hp-host hostname ip-address
ip irdpTo enable ICMP Router Discovery Protocol (IRDP) processing on an interface, use the ip irdp interface configuration command. To disable IRDP routing, use the no form of this command. ip irdp [multicast | holdtime seconds | maxadvertinterval seconds | minadvertinterval
ip mobile arpTo enable local-area mobility, use the ip mobile arp interface configuration command. To disable local-area mobility, use the no form of this command. ip mobile arp [timers keepalive hold-time] [access-group access-list-number | name]
ip name-serverTo specify the address of one or more name servers to use for name and address resolution, use the ip name-server global configuration command. To remove the addresses specified, use the no form of this command. ip name-server server-address1 [[server-address2]...server-address6]
ip natTo designate that traffic originating from or destined for the interface is subject to Network Address Translation (NAT), use the ip nat interface configuration command. To prevent the interface from being able to translate, use the no form of this command. ip nat {inside | outside}
ip nat inside destinationTo enable Network Address Translation (NAT) of the inside destination address, use the ip nat inside destination global configuration command. To remove the dynamic association to a pool, use the no form of this command.
ip nat inside sourceTo enable Network Address Translation (NAT) of the inside source address, use the ip nat inside source global configuration command. To remove the static translation or remove the dynamic association to a pool, use the no form of this command.
ip nat outside sourceTo enable Network Address Translation (NAT) of the outside source address, use the ip nat outside source global configuration command. To remove the static entry or the dynamic association, use the no form of this command.
ip nat poolTo define a pool of IP addresses for Network Address Translation (NAT), use the ip nat pool global configuration command. To remove one or more addresses from the pool, use the no form of this command.
ip nat translationTo change the amount of time after which Network Address Translation (NAT) translations time out, use the ip nat translation global configuration command. To disable the timeout, use the no form of this command.
ip netmask-formatTo specify the format in which netmasks are displayed in show command output, use the ip netmask-format line configuration command. To restore the default display format, use the no form of this command.
ip nhrp authenticationTo configure the authentication string for an interface using Next Hop Resolution Protocol (NHRP), use the ip nhrp authentication interface configuration command. To remove the authentication string, use the no form of this command. ip nhrp authentication string
ip nhrp holdtimeTo change the number of seconds that NHRP nonbroadcast, multiaccess (NBMA) addresses are advertised as valid in authoritative NHRP responses, use the ip nhrp holdtime interface configuration command. To restore the default value, use the no form of this command.
ip nhrp interestTo control which IP packets can trigger sending a Next Hop Resolution Protocol (NHRP) Request, use the ip nhrp interest interface configuration command. To restore the default value, use the no form of this command. ip nhrp interest access-list-number
ip nhrp mapTo statically configure the IP-to-NBMA address mapping of IP destinations connected to a nonbroadcast, multiaccess (NBMA) network, use the ip nhrp map interface configuration command. To remove the static entry from NHRP cache, use the no form of this command. ip nhrp map ip-address nbma-address
ip nhrp map multicastTo configure NBMA addresses used as destinations for broadcast or multicast packets to be sent over a tunnel network, use the ip nhrp map multicast interface configuration command. To remove the destinations, use the no form of this command. ip nhrp map multicast nbma-address
ip nhrp max-sendTo change the maximum frequency at which NHRP packets can be sent, use the ip nhrp max-send interface configuration command. To restore this frequency to the default value, use the no form of this command. ip nhrp max-send pkt-count every interval
ip nhrp network-idTo enable the Next Hop Resolution Protocol (NHRP) on an interface, use the ip nhrp network-id interface configuration command. To disable NHRP on the interface, use the no form of this command. ip nhrp network-id number
ip nhrp nhsTo specify the address of one or more NHRP Next Hop Servers, use the ip nhrp nhs interface configuration command. To remove the address, use the no form of this command. ip nhrp nhs nhs-address [net-address [netmask]]
ip nhrp recordTo re-enable the use of forward record and reverse record options in NHRP Request and Reply packets, use the ip nhrp record interface configuration command. To suppress the use of such options, use the no form of this command. ip nhrp record ip nhrp responderTo designate which interface's primary IP address the Next Hop Server will use in NHRP Reply packets when the NHRP requestor uses the Responder Address option, use the ip nhrp responder interface configuration command. To remove the designation, use the no form of this command. ip nhrp responder type number
ip nhrp useTo configure the software so that NHRP is deferred until the system has attempted to send data traffic to a particular destination multiple times, use the ip nhrp use interface configuration command. To restore the default value, use the no form of this command. ip nhrp use usage-count
ip probe proxyTo enable the HP Probe Proxy support, which allows the Cisco IOS software to respond to HP Probe Proxy Name requests, use the ip probe proxy interface configuration command. To disable HP Probe Proxy, use the no form of this command. ip probe proxy ip proxy-arpTo enable proxy ARP on an interface, use the ip proxy-arp interface configuration command. To disable proxy ARP on the interface, use the no form of this command. ip redirectsTo enable the sending of redirect messages if the Cisco IOS software is forced to resend a packet through the same interface on which it was received, use the ip redirects interface configuration command. To disable the sending of redirect messages, use the no form of this command. ip routingTo enable IP routing, use the ip routing global configuration command. To disable IP routing, use the no form of this command. ip subnet-zeroTo enable the use of subnet zero for interface addresses and routing updates, use the ip subnet-zero global configuration command. To restore the default, use the no form of this command. ip subnet-zero ip unnumberedTo enable IP processing on a serial interface without assigning an explicit IP address to the interface, use the ip unnumbered interface configuration command. To disable the IP processing on the interface, use the no form of this command. ip unnumbered type number
ping (privileged)To check host reachability and network connectivity, use the ping (IP packet internet groper function) privileged EXEC command. ping [protocol] {host | address}
ping (user)To check host reachability and network connectivity, use the ping (IP packet internet groper function) user EXEC command. ping [protocol] {host | address}
show arpTo display the entries in the ARP table, use the show arp privileged EXEC command. show arp show hostsTo display the default domain name, the style of name lookup service, a list of name server hosts, and the cached list of host names and addresses, use the show hosts EXEC command. show ip aliasesTo display the IP addresses mapped to TCP ports (aliases) and SLIP addresses, which are treated similarly to aliases, use the show ip aliases EXEC command. show ip arpTo display the Address Resolution Protocol (ARP) cache, where SLIP addresses appear as permanent ARP table entries, use the show ip arp EXEC command. show ip arp [ip-address] [hostname] [mac-address] [type number]
show ip interfaceTo display the usability status of interfaces configured for IP, use the show ip interface EXEC command. show ip interface [type number]
show ip irdpTo display IRDP values, use the show ip irdp EXEC command. show ip irdp show ip masksTo display the masks used for network addresses and the number of subnets using each mask, use the show ip masks EXEC command.
show ip nat statisticsTo display Network Address Translation (NAT) statistics, use the show ip nat statistics EXEC command. show ip nat translationsTo display active Network Address Translation (NAT) translations, use the show ip nat translations EXEC command. show ip nat translations [verbose]
show ip nhrpTo display the Next Hop Resolution Protocol (NHRP) cache, use the show ip nhrp EXEC command. show ip nhrp [dynamic | static] [type number]
show ip nhrp trafficTo display Next Hop Resolution Protocol (NHRP) traffic statistics, use the show ip nhrp traffic EXEC command. show ip redirectsTo display the address of a default gateway (router) and the address of hosts for which a redirect has been received, use the show ip redirects EXEC command. term ip netmask-formatTo specify the format in which netmasks are displayed in show command output, use the term ip netmask-format EXEC command. To restore the default display format, use the no form of this command.
trace (privileged)To discover the routes the packets follow when traveling to their destination from the router, use the trace privileged EXEC command.
trace (user)To discover the routes the router packets follow when traveling to their destination, use the trace user EXEC command.
tunnel modeTo set the encapsulation mode for the tunnel interface, use the tunnel mode interface configuration command. To set to the default, use the no form of this command. tunnel mode {aurp | cayman | dvmrp | eon | gre ip [multipoint] | nos}
|
Routing with Cisco 2500 and 1000 Series for LAN-ISDN Service
There are 3 different modes of operation within the Cisco IOS.
- Disabled mode
- Enabled mode
- Configuration mode
In the Disabled mode you can use a limited number of commands. This is used primarily to monitor the router.
The Enabled mode is used to show configuration information, enter the configuration mode, and make changes to the configuration.
The Configuration mode is used to enter and update the runtime configuration.
To get a list of the commands for the cisco type '?' at the prompt. To get further information about any command, type the command followed by a '?'.
clear | Reset functions |
clock | Manage the system clock |
configure | Enter configuration mode |
debug | Debugging functions (see also 'undebug') |
disable | Turn off privileged commands |
enable | Turn on privileged commands |
erase | Erase flash or configuration memory |
exit | Exit from the EXEC |
help | Description of the interactive help system |
login | Log in as a particular user |
logout | Exit from the EXEC |
no | Disable debugging functions |
ping | Send echo messages |
reload | Halt and perform a cold restart |
setup | Run the SETUP command facility |
show | Show running system information |
telnet | Open a telnet connection |
terminal | Set terminal line parameters |
test | Test subsystems, memory, and interfaces |
traceroute | Trace route to destination |
tunnel | Open a tunnel connection |
undebug | Disable debugging functions (see also 'debug') |
verify | Verify checksum of a Flash file |
write | Write running configuration to memory, network, or terminal |
show | |
access-lists | List access lists |
arp | ARP table |
buffers | Buffer pool statistics |
configuration | Contents of Non-Volatile memory |
controllers | Interface controller status |
debugging | State of each debugging option |
dialer | Dialer parameters and statistics |
extended | Extended Interface Information |
flash | System Flash information |
flh-log | Flash Load Helper log buffer |
history | Display the session command history |
hosts | IP domain-name, lookup style, name servers, and host table |
interfaces | Interface status and configuration |
ip | IP information |
isdn | ISDN information |
line | TTY line information |
logging | Show the contents of logging buffers |
memory | Memory statistics |
privilege | Show current privilege level |
processes | Active process statistics |
protocols | Active network routing protocols |
queue | Show queue contents |
queueing | Show queueing configuration |
reload | Scheduled reload information |
route-map | route-map information |
running-config | Current operating configuration |
sessions | Information about Telnet connections |
smf | Software MAC filter |
stacks | Process stack utilization |
startup-config | Contents of startup configuration |
subsys | Show subsystem information |
tcp | Status of TCP connections |
terminal | Display terminal configuration parameters |
users | Display information about terminal lines |
version | System hardware and software status |
Other Useful Commands
View the Software Version
View the Ethernet IP
View the Serial IP
View the Default Route
View the Filters
View the Bandwidth
Add a Static Route
Change the Dial Number
Turn Filters On and Off
Ping from the Router
Traceroute from the Router
View the Software Version
Cisco>en Cisco#wr term <--- Shows the running configuration Building configuration... Current configuration: ! version 11.2 no service udp-small-servers no service tcp-small-servers ! hostname Cisco ! interface Ethernet0 ip address 192.168.1.1 255.255.255.0 ! interface Serial0 ip address 192.168.6.1 255.255.255.0 encapsulation frame-relay frame-relay lmi-type ansi ! interface Serial1 ip address 192.168.4.2 255.255.255.0 encapsulation frame-relay bandwidth 1536 keepalive 5 frame-relay map ip 192.168.4.1 101 IETF ! router rip version 2 network 192.168.4.0 network 192.168.6.0 neighbor 192.168.6.2 neighbor 192.168.4.1 ! ip classless ip route 0.0.0.0 0.0.0.0 192.168.6.2 ip route 0.0.0.0 0.0.0.0 192.168.4.1 ! line con 0 line aux 0 line vty 0 4 login ! end
View the Ethernet IP
Router#wr term
This will show the running configuration. Within the configuration, you will see an interface ethernet 0 section:
interface Ethernet0 ip address 38.150.93.1 255.255.255.0 no ip directed-broadcast
View the Serial IP
Router#wr term
Within the configuration, you will see an interface serial 0 section:
interface Serial0 ip address 38.21.10.100 255.255.255.0 ip broadcast-address 38.21.10.255 ip access-group 106 in encapsulation frame-relay bandwidth 56 no fair-queue frame-relay map ip 38.21.10.1 500 IETF
View the Default Route
Router#wr term
Within the configuration, you will see an ip route section.
In the ip route section, look for a route: ip route 0.0.0.0 0.0.0.0 38.167.29.1 The last ip address is the POP ip.
View the Filters
Router#wr term
Under interface serial 0, look for:
ip access-group 104 in ip access-group 105 out
This means that access-group 104 is the inbound filter set and access-group 105 is the outbound filter set. Then, continue to look in the configuration for the access-list statements:
(Example access-list statements) access-list 104 deny ip 38.166.101.0 0.0.0.255 any access-list 104 permit tcp any any established access-list 104 permit tcp any eq ftp-data any gt 1023 access-list 104 permit udp any eq domain any gt 1023 access-list 104 permit udp any eq domain any eq domain access-list 104 permit icmp any any access-list 104 permit udp any eq snmp any gt 1023 access-list 105 deny ip any 38.166.101.0 0.0.0.255 access-list 105 permit tcp any any established access-list 105 permit tcp any any eq ftp access-list 105 deny udp any eq netbios-ns any access-list 105 deny udp any eq netbios-dgm any access-list 105 permit ip any any
View the Bandwidth
Router#wr term
Within the config, you will see an interface serial 0 section:
interface Serial0 ip address 38.21.10.100 255.255.255.0 ip broadcast-address 38.21.10.255 ip access-group 106 in encapsulation frame-relay bandwidth 56 no fair-queue frame-relay map ip 38.21.10.1 500 IETF
Add a Static Route
Cisco#config t Enter configuration commands, one per line. End with CNTL/Z. Cisco(config)#ip route DEST.DEST.DEST.DEST MASK.MASK.MASK.MASK GATE.GATE.GATE.GATE where: DEST.DEST.DEST.DEST = The destination network the static route is for MASK.MASK.MASK.MASK = The subnet mask of the destination network GATE.GATE.GATE.GATE = The gateway of the static route Example route statement: ip route 38.222.75.0 255.255.255.0 38.20.5.1 Cisco(config)#^Z (hit z)
Write the entry to memory:
Cisco#wr mem Building configuration... [OK]
Change the Dial Number
Type en to put the router in enable mode:
test.com>en
The password should be the same as the one used to telnet in.
Password:
To view the router's configuration, type:
test.com#show config
There will be a line in the configuration that says:
dialer map IP 38.1.1.1 speed 64 name LD3330 2707000
The 2707000 is the dial number.
NOTE: Record what interface the dialer map IP line is under because you will need to use that interface when changing the number.
Type config t to configure from terminal.
test.com#config t
Enter configuration commands, one per line. End with CNTL/Z. Enter the interface that the dialer map IP line is under:
test.com(config)#interface BRI0
Add in the new dialer map IP line with the new phone number:
test.com(config)#dialer map IP 38.1.1.1 speed 64 name LD3330 [new number]
Now, remove the old dialer map IP line. To remove a line, type no and then the line. For example, to remove the old dialer map IP, type:
test.com(config)#no dialer map IP 38.1.1.1 speed 64 name LD3330 2707020
Now leave config mode:
test.com(config)# [control] z
Save changes:
test.com# write mem Building configuration... [OK]
Verify the new number is in the config:
test.com#show config
The new number should be in the dialer map IP line.
Turn Filters On and Off
To turn the filters off:
Router#configure terminal Router(config)#interface Serial0 Router(config-if)#no ip access-group 104 in Router(config-if)#no ip access-group 105 out Router(config-if)# Hit CTRL-Z Router#wr mem Building configuration... [OK] Router#
To turn the filters on:
Router#configure terminal Router(config)#interface Serial0 Router(config-if)#ip access-group 104 in Router(config-if)#ip access-group 105 out Router(config-if)# Hit CTRL-Z Router#wr mem Building configuration... [OK] Router#
Ping from the Router
Cisco#ping Example: Cisco#ping 38.8.14.2