且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CCNA综合实验案例

更新时间:2022-10-01 22:24:47

实验拓扑图
CCNA综合实验案例

1.配置IP地址,所有接口up状态(略)
2.
3.配置VTP协议,SW1为VTP Server ,SW2为VTP Client
  SW1配置:
en
conf t
vtp domain ccna 
vtp mode server
vtp password cisco
  SW2配置:
en
conf t
vtp domain ccna
vtp mode client
vtp password cisco

4.VLAN配置。保证SW2可以使用vtp协议从SW1同步vlan配置信息。配置pc到对应的vlan。
  SW1配置:
en
conf t
vlan 2
vlan 3 
exit

int range f0/23 - 24
switchport mode trunk 
int f0/2
swichport mode access
swichport access vlan 2
int f0/3
swichport mode access
swichport access vlan 3
exit
  SW2配置:
en
conf t
int range f0/23 - 24
switchport mode trunk 
int f0/1
swichport mode access
swichport access vlan 2
int f0/2
swichport mode access
swichport access vlan 3
exit

5.配置路由器R1的子接口,支持vlan间路由
  SW2配置:
int f0/0
no shut
int f0/0.1
encapsulation dot1Q 1       必须先将子接口封装为802.1Q,才能成功为子接口配置ip地址
ip add 192.168.1.1 255.255.255.0
no shut
int f0/0.2
encapsulation dot1Q 1 
ip add 192.168.2.1 255.255.255.0
no shut
int f0/0.3
encapsulation dot1Q 1
ip add 192.168.3.1 255.255.255.0
no shut
exit

6.配置STP协议。配置生成树协议使SW1为根交换机 
  SW1配置:
spanning-tree vlan 1,2,3 root primary     

7.配置DHCP。在R1上配置DHCP,是4台pc都可以获取正确的ip地址、网关和DNS,DNS服务器的地址是218.1.1.2
  R1配置:
ip dhcp pool pool1             配置dhcp地址池名称为pool1
network 192.168.2.0 255.255.255.0    分配192.168.2.0网段的ip地址
default-router 192.168.2.1           设置默认网关
dns-server 218.1.1.2                 设置DNS服务器地址
exit
ip dhcp excluded-address 192.168.2.1  把网关地址排除地址池

ip dhcp pool pool2
network 192.168.3.0 255.255.255.0
default-router 192.168.3.1
dns-server 218.1.1.2
exit
ip dhcp excluded-address 192.168.3.1
  在PC机上设置自动获取IP地址:
CCNA综合实验案例

8.配置路由协议。R2、R3、R4上运行OSPF,4台路由器互通  
  R1配置:
ip route 0.0.0.0 0.0.0.0 12.1.1.2   默认路由
  R2配置:
router ospf 100
network 12.1.1.2 0.0.0.0 area 0
network 23.1.1.2 0.0.0.0 area 0 
network 24.1.1.4 0.0.0.0 area 0 
exit
  R3配置:
router ospf 100
network 23.1.1.3 0.0.0.0 area 0
network 34.1.1.3 0.0.0.0 area 0 
exit
  R4配置:
router ospf 100
network 24.1.1.4 0.0.0.0 area 0
network 34.1.1.4 0.0.0.0 area 0 
network 218.1.1.1 0.0.0.0 area 0 
exit

9.配置PPP协议。路由器R1和R2之间封装PPP协议,使用CHAP验证,密码cisco
  R1配置:
int s1/0
enencapsulation ppp
ppp authentication chap        配置验证方式为CHAP
exit
username r2 password cisco     配置本地验证使用的用户名和密码,CHAP中用户名要使用对方路由器的名字
  R2配置:
int s1/0
enencapsulation ppp
ppp authentication chap
exit
username r1 password cisco    在CHAP验证中,两端路由器要基于密码计算HASH值,两端配置的密码一定要相同

10.配置NAT。使4台PC都可以通过R1访问internet
    R1配置:
access-list 1 permit 192.168.2.0 0.0.0.255        规定哪些内部地址段可以进行动态地址转换
access-list 1 permit 192.168.3.0 0.0.0.255
ip nat inside source list 1 int s1/0 overload     复用的地址配置为路由器的WAN口
int f0/0.2
ip nat inside 
int f0/0.3
ip nat inside
int s1/0
ip nat outside 
exit
   验证NAT:
CCNA综合实验案例
CCNA综合实验案例
    


     本文转自kindIT 51CTO博客,原文链接:http://blog.51cto.com/kindit/1086833,如需转载请自行联系原作者