Router configuration BASICS (2)

Source: Internet
Author: User

Iv. Common commands
1. Help
In IOS operations, you can type "?" regardless of the status or location. Get help from the system.
2. Change the command status

3. Display commands

4. Copy command
Used for IOS and CONFIG backup and upgrade

 

5. Network commands

6. Basic settings command

5. Configure IP addressing
1. IP address category
The IP addresses are divided into two parts: the network address and the host address. The first eight digits of the Class A address are the network address, the last 24 digits are the host address, and the 16 digits of the Class B address are the network address, the last 16 digits are the host address, the first 24 digits are the network address, and the last 8 digits are the host address. The network address range is shown in the following table:

2. Allocate an interface IP Address

Mask) is used to identify the number of network addresses in the ip address, ip address-address) and mask) and obtain the network address.
3. Use a subnet mask with a variable length
The variable-length subnet mask can be used to enable networks with the same network number on different interfaces to use different masks. This saves IP addresses and makes full use of valid IP address space.
As shown in:

 

The E0 ports of Router1 and Router2 both use Class C address 192.1.0.0 as the network address, the E0 network address of Router1 is 192.1.0.128, the mask is 255.255.255.192, And the E0 network address of Router2 is 192.1.0.64, the mask is 255.255.255.255.192. In this way, a class C network address is allocated to two networks, which are divided into two subnets, thus saving the address.
4. Use Network Address Translation (NAT)
NATNetwork Address Translation) is used to translate an internal private Address into an external legal global Address, which allows users with illegal IP addresses to access the external Internet through NAT.
When creating an intranet, we recommend that you use the following address groups for hosts. These addresses are reserved by the Network Working Group (RFC 1918) for private Network address allocation.
L Class A: 10.1.1.1 to 10.254.254.254
L Class B: 172.16.1.1 to 172.31.254.254
L Class C: 192.168.1.1 to 192.168.254.254
Command description:

As shown in

The Ethernet port 0 of the router is the inside port, that is, the port connects to the internal network, and the network connected to this port should be translated, and the Serial port 0 is the outside Port, A host with a valid IP address assigned by the NIC or service provider). A host from the network 10.1.1.0/24 selects an address from the IP address pool c2501 as its own valid IP address, access the Internet through the Serial 0 port. The command ip nat inside source list 2 pool c2501 overload parameter overload will allow multiple internal addresses to use the same global address as a valid ip address, it is the address allocated by the NIC or service provider ). The command ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192 defines the global address range.
The settings are as follows:

ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192 
interface Ethernet 0
ip address 10.1.1.1 255.255.255.0
ip nat inside
!
interface Serial 0
ip address 202.200.10.5 255.255.255.252
ip nat outside
!
ip route 0.0.0.0 0.0.0.0 Serial 0
access-list 2 permit 10.0.0.0 0.0.0.255
! Dynamic NAT
!
ip nat inside source list 2 pool c2501 overload
line console 0
exec-timeout 0 0
!
line vty 0 4
end

6. Configure static routes
By configuring Static Routing, You can manually specify the path to access a certain network. The network structure is relatively simple, generally, Static Routing is used when the path to a network is unique.

Prefix: destination network to be reached
Mask: Subnet mask
Address: the IP address of the next hop, that is, the port address of the adjacent router.
Interface: Local Network interface
Distance: Management distance (optional)
Tag: optional tag values)
Permanent: specify that the route will not be removed even if the port is switched off.

The next hop address for access 192.1.0.64/26 is set to 192.200.10.6 on Router1, that is, when a destination address belongs to the network range of 192.1.0.64/26, route it to an adjacent router with the address 192.200.10.6. On Router3, the next hop address for access to the 192.1.0.128/26 and 192.200.10.4/30 networks is set to 192.1.0.65. Because the Serial 0 address on Router1 is 192.200.10.5 and 192.200.10.4/30 belong to a directly connected network, there is a path to access 192.200.10.4/30, so you do not need to add a static route on router1.

Router1: 
ip route 192.1.0.64 255.255.255.192 192.200.10.6 
Router3:
ip route 192.1.0.128 255.255.255.192 192.1.0.65
ip route 192.200.10.4 255.255.255.252 192.1.0.65 

At the same time, because Router3 is no longer connected to other routers except router Router2, you can also assign a default route to it to replace the above two static routes,
Ip route 0.0.0.0 0.0.0.0 192.1.0.65
That is, as long as the path to the specific destination address is not found in the routing table, the data is routed to the adjacent router with the address 192.1.0.65.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.