Cisco Router

aliveboonevilleNetworking and Communications

Oct 28, 2013 (3 years and 9 months ago)

86 views

C
isco
实验五

静态路由与默认路由


1
网络拓扑


2

实验要求

在路由器
Router0

R潵ter1
上设置静态路由,在路由器
R潵ter2
上设置默
认路由,实现全网连通。

3

实验配置


Router
0


Router(config)#interface fastEthernet 0/0

Router(config
-
if)#ip address 172.16.2.1 255.255.255.0

Router(config
-
if)#no shutdown

%LINK
-
5
-
CHANGED: Inter
face FastEthernet0/0, changed state to up

Router(config
-
if)#exit

Router(config)#interface fastEthernet 0/1

Router(config
-
if)#ip address 172.16.1.1 255.255.255.0

Router(config
-
if)#no sh


%LINK
-
5
-
CHANGED: Interface FastEthernet0/1, changed state to up

%LINEP
ROTO
-
5
-
UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config
-
if)#exit

Router#show ip interface brief

Interface IP
-
Address OK? Method Status Protocol



FastEthernet0/0 172.16.2.1

YES manual up down



FastEthernet0/1 172.16.1.1 YES manual up up



Vlan1 unassigned YES manual administratively down down


Router#show ip route

Codes: C
-

connected, S
-

static, I
-

IGRP, R
-

RIP, M
-

mobile, B
-

BGP


D
-

EIGRP, EX
-

EIGRP external, O
-

OSPF, IA
-

OSPF inter area


N1
-

OSPF NSSA external type 1, N2
-

OSPF NSSA external type 2


E1
-

OSPF external type 1, E2
-

OSPF external type 2, E
-

EGP


i
-

I
S
-
IS, L1
-

IS
-
IS level
-
1, L2
-

IS
-
IS level
-
2, ia
-

IS
-
IS inter area


*
-

candidate default, U
-

per
-
user static route, o
-

ODR


P
-

periodic downloaded static route

Gateway of last resort is not set


172.16.0.0/24 is subnetted, 1 subnets

C

172.16.1.0 is directly connected, FastEthernet0/1



Router
1


Router(config)#hostname Router1

Router1(config)#interface fastEthernet 0/0

Router1(config
-
if)#ip address 172.16.2.2 255.255.255.0

Router1(config
-
if)#no sh

%LINK
-
5
-
CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO
-
5
-
UPDOWN: Line p
rotocol on Interface FastEthernet0/0, changed state to up

Router1(config
-
if)#exit

Router1(config)#interface fastEthernet 0/1

Router1(config
-
if)#ip address 172.16.3.2 255.255.255.0

Router1(config
-
if)#no sh

%LINK
-
5
-
CHANGED: Interface FastEthernet0/1, changed

state to up

Router1(config
-
if)#exit

Router1(config)#exit

Router1#show ip in br

Interface IP
-
Address OK? Method Status Protocol



FastEthernet0/0 172.16.2.2 YES manual up up



FastEthernet0/1

172.16.3.2 YES manual up down



Vlan1 unassigned YES manual administratively down down

Router1#show ip route

Codes: C
-

connected, S
-

static, I
-

IGRP, R
-

RIP, M
-

mobile, B
-

BGP


D
-

EIGRP, EX

-

EIGRP external, O
-

OSPF, IA
-

OSPF inter area


N1
-

OSPF NSSA external type 1, N2
-

OSPF NSSA external type 2


E1
-

OSPF external type 1, E2
-

OSPF external type 2, E
-

EGP


i
-

IS
-
IS, L1
-

IS
-
IS level
-
1, L2
-

IS
-
IS level
-
2, ia
-

IS
-
I
S inter area


*
-

candidate default, U
-

per
-
user static route, o
-

ODR


P
-

periodic downloaded static route

Gateway of last resort is not set


172.16.0.0/24 is subnetted, 1 subnets

C 172.16.2.0 is directly connected, FastEthernet0/0



Router
2


Router(config)#hostname Router2

Router2(config)#interface fastEthernet 0/0

Router2(config
-
if)#ip address 172.16.3.1 255.255.255.0

Router2(config
-
if)#no sh

%LINK
-
5
-
CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO
-
5
-
UPDOWN: Line p
rotocol on Interface FastEthernet0/0, changed state to up

Router2(config
-
if)#exit

Router2(config)#interface fastEthernet 0/1

Router2(config
-
if)#ip address 172.16.4.1 255.255.255.0

Router2(config
-
if)#no sh

%LINK
-
5
-
CHANGED: Interface FastEthernet0/1, changed

state to up

%LINEPROTO
-
5
-
UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router2(config
-
if)#exit

Router2(config)#exit

Router2#show ip interface brief

Interface IP
-
Address OK? Method Status Protocol



FastEthernet0/0 172.16.3.1 YES manual up up



FastEthernet0/1 172.16.4.1 YES manual up up



Vlan1 unassigned YES manual administratively down down

Router2#show ip route

Codes: C
-

connected, S
-

static, I
-

IGRP, R
-

RIP, M
-

mobile, B
-

BGP


D
-

EIGRP, EX
-

EIGRP external, O
-

OSPF, IA
-

OSPF inter area


N1
-

OSPF NSSA external type 1, N2
-

OSPF NSSA external type 2


E1
-

OSPF external type 1, E2
-

OSPF

external type 2, E
-

EGP


i
-

IS
-
IS, L1
-

IS
-
IS level
-
1, L2
-

IS
-
IS level
-
2, ia
-

IS
-
IS inter area


*
-

candidate default, U
-

per
-
user static route, o
-

ODR


P
-

periodic downloaded static route

Gateway of last resort is not set


17
2.16.0.0/24 is subnetted, 2 subnets

C 172.16.3.0 is directly connected, FastEthernet0/0

C 172.16.4.0 is directly connected, FastEthernet0/1



Router
0


Router(config)#ip route 172.16.4.0 255.255.255.0 172.16.2.2

Router(config)#exit

Router#show ip route

Codes: C
-

connected, S
-

static, I
-

IGRP, R
-

RIP, M
-

mobile, B
-

BGP


D
-

EIGRP, EX
-

EIGRP external, O
-

OSPF, IA
-

OSPF inter area



N1
-

OSPF NSSA external type 1, N2
-

OSPF NSSA external type 2


E1
-

OSPF external type 1, E2
-

OSPF external type 2, E
-

EGP


i
-

IS
-
IS, L1
-

IS
-
IS level
-
1, L2
-

IS
-
IS level
-
2, ia
-

IS
-
IS inter area


*
-

candidate default, U
-

per
-
u
ser static route, o
-

ODR


P
-

periodic downloaded static route

Gateway of last resort is not set


172.16.0.0/24 is subnetted, 4 subnets

C 172.16.1.0 is directly connected, FastEthernet0/1

C 172.16.2.0 is directly connected, FastEther
net0/0

S 172.16.3.0 [1/0] via 172.16.2.2

S 172.16.4.0 [1/0] via 172.16.2.2



Router
1


Router1(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1

Router1(config)#ip route 172.16.4.0 255.255.255.0 172.16.3.1

Router1(config)#exit

%SYS
-
5
-
CONFIG_I
: Configured from console by console

Router1#show ip route

Codes: C
-

connected, S
-

static, I
-

IGRP, R
-

RIP, M
-

mobile, B
-

BGP


D
-

EIGRP, EX
-

EIGRP external, O
-

OSPF, IA
-

OSPF inter area


N1
-

OSPF NSSA external type 1, N2
-

OSPF NSSA
external type 2


E1
-

OSPF external type 1, E2
-

OSPF external type 2, E
-

EGP


i
-

IS
-
IS, L1
-

IS
-
IS level
-
1, L2
-

IS
-
IS level
-
2, ia
-

IS
-
IS inter area


*
-

candidate default, U
-

per
-
user static route, o
-

ODR


P
-

periodic downlo
aded static route

Gateway of last resort is not set


172.16.0.0/24 is subnetted, 4 subnets

S 172.16.1.0 [1/0] via 172.16.2.1

C 172.16.2.0 is directly connected, FastEthernet0/0

C 172.16.3.0 is directly connected, FastEthernet0/1

S

172.16.4.0 [1/0] via 172.16.3.1



Router
2


Router2(config)#ip route 0.0.0.0 0.0.0.0 172.16.3.2

Router2(config)#exit

%SYS
-
5
-
CONFIG_I: Configured from console by console

Router2#show ip route

Codes: C
-

connected, S
-

static, I
-

IGRP, R
-

RIP, M
-

mobile, B
-

BGP


D
-

EIGRP, EX
-

EIG
RP external, O
-

OSPF, IA
-

OSPF inter area


N1
-

OSPF NSSA external type 1, N2
-

OSPF NSSA external type 2


E1
-

OSPF external type 1, E2
-

OSPF external type 2, E
-

EGP


i
-

IS
-
IS, L1
-

IS
-
IS level
-
1, L2
-

IS
-
IS level
-
2, ia
-

IS
-
IS inte
r area


*
-

candidate default, U
-

per
-
user static route, o
-

ODR


P
-

periodic downloaded static route

Gateway of last resort is 172.16.3.2 to network 0.0.0.0


172.16.0.0/24 is subnetted, 2 subnets

C 172.16.3.0 is directly connected, FastEthernet0/0

C 172.16.4.0 is directly connected, FastEthernet0/1

S* 0.0.0.0/0 [1/0] via 172.16.3.2


4

测试

PC0 PC1 PC2
可以互相
ping
通。