配置路由器
- 格式:doc
- 大小:53.00 KB
- 文档页数:4
1.为路由器配置端口IP协议
R1
R1(config)#int f0/0
R1(config-if)#ip address 172.16.1.2 255.255.255.0 R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#int S0/0
R1(config-if)#ip address 172.16.2.1 255.255.255.0 % 172.16.2.1 255.255.255.0 overlaps with s0/0
R1(config-if)#no shutdown
R1(config-if)#clock rate 64000
R1(config-if)#exit
R1(config)#int S0/1
R1(config-if)#ip address 172.16.3.1 255.255.255.0 % 172.16.3.1 255.255.255.0 overlaps with s0/1
R1(config-if)#no shutdown
R1(config-if)#clock rate 64000
R1(config-if)#exit
R2
R2(config)#int f0/1
R2(config-if)#ip address 172.16.4.2 255.255.255.0 R2(config-if)#no shutdown
R2(config)#int S0/0
R2(config-if)#ip address 172.16.2.2 255.255.255.0 % 172.16.2.2 255.255.255.0 overlaps with s0/0
R2(config-if)#no shutdown
R2(config-if)#clock rate 64000
R2(config-if)#
R3
router(config)#hostname R3
R3(config)#int f0/0
R3(config-if)#ip address 172.16.5.2 255.255.255.0 R3(config-if)#no shutdown
R3(config-if)#int S0/1
R3(config-if)#ip address 172.16.3.2 255.255.255.0 % 172.16.3.2 255.255.255.0 overlaps with s0/1
R3(config-if)#no shutdown
R3(config-if)#clock rate 64000
R3(config-if)#exit
2.为路由器配置RIP协议
R1
R1(config)#ip routing
R1(config)#route rip
R1(config-router)#version 2
R1(config-router)#network 172.16.1.0
R1(config-router)#network 172.16.2.0
R1(config-router)#network 172.16.3.0
R1(config-router)#exit
R1(config)#
R2
R2(config)#ip routing
R2(config)#route rip
R2(config-router)#version 2
R2(config-router)#network 172.16.2.0
R2(config-router)#network 172.16.4.0
R2(config-router)#exit
R3
R3(config)#ip routing
R3(config)#route rip
R3(config-router)#version 2?
R3(config-router)#network 172.16.3.0
R3(config-router)#network 172.16.5.0
R3(config-router)#
3.设置各PC机的参数
PC1
PCA login: root
Password: linux
[root@PCA root]# ifconfig eth0 172.16.1.1 netmask 255.255.255.0 [root@PCA root]# ifconfig
eth0 inet addr: 172.16.1.1 mask: 255.255.255.0 loopback inet addr: 127.0.0.1 mask: 255.0.0.0
[root@PCA root]# route add default gw 172.16.1.2
[root@PCA root]# route
default gateway: 172.16.1.2
PC2
PCB login: root
Password: linux
[root@PCB root]# ifconfig eth0 172.16.4.1 netmask 255.255.255.0 [root@PCB root]# ifconfig
[root@PCB root]# route add default gw 172.16.4.2
[root@PCB root]# route
default gateway: 172.16.4.2
PC3
PCC login: root
Password: linux
[root@PCC root]# ifconfig eth0 172.16.5.1 netmask 255.255.255.0
[root@PCC root]# ifconfig
[root@PCC root]# route add default gw 172.16.5.2
[root@PCC root]# route
default gateway: 172.16.5.2
4.测试网络连通性
PCA ip : 172.16.1.1 255.255.255.0
PCA gw : 172.16.1.2
PCB ip : 172.16.4.1 255.255.255.0
PCB gw : 172.16.4.2
PCC ip : 172.16.5.1 255.255.255.0
PCC gw : 172.16.5.2
ROA F0/0: 172.16.1.2 255.255.255.0
ROA S0/0: 172.16.2.1 255.255.255.0
ROA S0/1: 172.16.3.1 255.255.255.0
ROA RIP: yes
ROA ip routing: yes
network=172.16.1.0 255.255.0.0|172.16.2.0 255.255.0.0|172.16.3.0 255.255.0.0 ROB F0/1: 172.16.4.2 255.255.255.0
ROB S0/0: 172.16.2.2 255.255.255.0
ROB RIP: yes
ROB ip routing: yes
network=172.16.2.0 255.255.0.0|172.16.4.0 255.255.0.0 ROC F0/0: 172.16.5.2 255.255.255.0
ROC S0/1: 172.16.3.2 255.255.255.0
ROC RIP: yes
ROC ip routing: yes
network=172.16.3.0 255.255.0.0|172.16.5.0 255.255.0.0 源VLan: 1 目标VLan:。