(+84) 236.3827111 ex. 402

Định tuyến tĩnh dùng Next-Hop


Cho sơ đồ mạng như sau:

Yêu cầu:

- Kết nối giữa Router vs Router thì Router có ID nhỏ hơn sẽ nhận Start IP

- Kết nối giữa Router vs PC thì Router sẽ nhận Start IP và PC nhận Start IP + 1

- Hãy cấu hình định tuyến tĩnh dùng Next-Hop theo hướng mũi tên trong sơ đồ.

Cấu hình:

Trên PC1:

Trên PC2:

Trên PC3:

Trên Router R1:

R1#show running-config

Building configuration...


Current configuration : 861 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname R1

!

!

!

!

!

!

!

!

no ip cef

no ipv6 cef

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

ip address 192.168.1.1 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface Serial0/0/0

ip address 192.168.12.1 255.255.255.252

clock rate 2000000

!

interface Serial0/0/1

ip address 192.168.13.1 255.255.255.252

!

interface Vlan1

no ip address

shutdown

!

ip classless

ip route 192.168.2.0 255.255.255.0 192.168.12.2

ip route 192.168.3.0 255.255.255.0 192.168.12.2

ip route 192.168.23.0 255.255.255.0 192.168.12.2

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end



R1#


Trên Router R2:

R2#show running-config

Building configuration...


Current configuration : 858 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname R2

!

!

!

!

!

!

!

!

ip cef

no ipv6 cef

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

ip address 192.168.2.1 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface Serial0/0/0

ip address 192.168.12.2 255.255.255.252

!

interface Serial0/0/1

ip address 192.168.23.1 255.255.255.252

clock rate 2000000

!

interface Vlan1

no ip address

shutdown

!

ip classless

ip route 192.168.13.0 255.255.255.0 192.168.23.2

ip route 192.168.1.0 255.255.255.0 192.168.23.2

ip route 192.168.3.0 255.255.255.0 192.168.23.2

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end



R2#


Trên Router R3:

R3#show running-config

Building configuration...


Current configuration : 858 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname R3

!

!

!

!

!

!

!

!

ip cef

no ipv6 cef

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

ip address 192.168.3.1 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface Serial0/0/0

ip address 192.168.13.2 255.255.255.252

clock rate 2000000

!

interface Serial0/0/1

ip address 192.168.23.2 255.255.255.252

!

interface Vlan1

no ip address

shutdown

!

ip classless

ip route 192.168.2.0 255.255.255.0 192.168.13.1

ip route 192.168.1.0 255.255.255.0 192.168.13.1

ip route 192.168.12.0 255.255.255.0 192.168.13.1

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end



R3#

Xem bảng định tuyến trên các Router:

R1#show ip route


Gateway of last resort is not set


C 192.168.1.0/24 is directly connected, FastEthernet0/0

S 192.168.2.0/24 [1/0] via 192.168.12.2

S 192.168.3.0/24 [1/0] via 192.168.12.2

192.168.12.0/30 is subnetted, 1 subnets

C 192.168.12.0 is directly connected, Serial0/0/0

192.168.13.0/30 is subnetted, 1 subnets

C 192.168.13.0 is directly connected, Serial0/0/1

S 192.168.23.0/24 [1/0] via 192.168.12.2

R1#


R2#show ip route

Gateway of last resort is not set


S 192.168.1.0/24 [1/0] via 192.168.23.2

C 192.168.2.0/24 is directly connected, FastEthernet0/0

S 192.168.3.0/24 [1/0] via 192.168.23.2

192.168.12.0/30 is subnetted, 1 subnets

C 192.168.12.0 is directly connected, Serial0/0/0

S 192.168.13.0/24 [1/0] via 192.168.23.2

192.168.23.0/30 is subnetted, 1 subnets

C 192.168.23.0 is directly connected, Serial0/0/1

R2#


R3#show ip route

Gateway of last resort is not set


S 192.168.1.0/24 [1/0] via 192.168.13.1

S 192.168.2.0/24 [1/0] via 192.168.13.1

C 192.168.3.0/24 is directly connected, FastEthernet0/0

S 192.168.12.0/24 [1/0] via 192.168.13.1

192.168.13.0/30 is subnetted, 1 subnets

C 192.168.13.0 is directly connected, Serial0/0/0

192.168.23.0/30 is subnetted, 1 subnets

C 192.168.23.0 is directly connected, Serial0/0/1

R3#