扩展网络实验知识点和概括


                                          综合二

一.设备初始化(以R1为例)

Router>enable

Router#configure terminal

Router (config) #hostname R1

Rl (config) #no ip domain-lookup 关闭域名解析

R1 (config) #enable secret jwcisco

Rl(config)#line console 0 //console口配置

Rl (config-line) #exec-timeout 10 4

Rl (config-line)#logging synchronous

Rl (config-line) #password jwccna

Rl (config-line) #login

Rl (config-line)#line vty 0 4

Rl (config-line) #exec-timeout 5 2

Rl (config-line)#logging synchronous  配置光标跟踪

Rl (config-line) #password jwccna

Rl (config-line)#login

二.区域划分(以SW3为例)

Sw3 (config)#vlan 90 创建vlan

Sw3(config-vlan) #name ADMIN  //vlan名称

Sw3 (config-vlan) #int vlan90

Sw3 (config-if) #ip address 192.168.90.1 255.255.255.0

三.Vtp配置(SW1服务器配置)

swl (config)#vtp mode server//设置vtp模式

sw1 (config)#vtp domain jsj 域名

Swl (config)#vtp password l4wg 密码

其余交换机客户端配置(以SW2为例)

Sw2(config)#vtp mode client

Sw2 (config)#vtp domain jsj

Sw2(config)#vtp password l4wg

四.配置各vlan的主次根桥(以SW1为例)

sw1 (config)#spanning-tree vlan 2 root primary SW1配置为vlan2的主根桥

sw1 (config)#spanning-tree vlan i root primary

sw1 (config)#spanning-tree vlan 3 root primary

sw1 (config)#spanning-tree vlan 90 root primary

sw1 (config) #spanning-tree vlan 4 root secondary 配置为vlan4的次根桥

Swl (config)#spanning-tree vlan 5 root secondary

五.单臂路由及配置接口地址(以R1为例)

Rl(config-if)#int f0/0.99

Rl(config-subif) #encapsulation dotlo 99

Rl (config-subif)#ip address 192.168.99.254 255.255.255.0

Rl (config-subif)#int f0/0.100

Rl (config-subif) #encapsulation dot1o 100

Rl (config-subif)#ip address 192.168.100.254 255.255.255.0

Rl (config-subif)#exit

R1config#int f0/0

R1config-if# no shutdown

六.链路汇聚(以SW2为例)

Sw2 (config) #interface range f0/ 3-4

sw2 (config-if-range)#switchport trunk encapsulation dotlq

Sw2 (config-if-range)|#switchport mode trunk

sw2 (config-if-range)#channe1-group 1 mode on

sw2 (config)#interface port-channel 1

sw2 (config-if)#switchport mode trunk

七.HSRP配置(以SW1为例)

SW1config#int vlan2

SW1config-if#standby 2 ip 192.168.2.254

SW1config-if#standby 2 priority 150 优先级

SW1config-if#standby 2 preempt  抢占

SW1config-if#standby 2 track f0/1  跟踪端口

SW1config-if#standby 2 track f0/24

八.EIGRP配置 (路由器以R1为例)

R1 (config) #router eigrp 100

R1 (config-router) #no auto-summary

R1 (config-router) #network 112.10.12.0 0.0.0.7

R1 (config-router) #network 178.20.12.0 0.0.0.7

R1 (config-router) #network 192.168.99.0 0.0.0.255

R1 (config-router) #network 192.168.100.0 0.0.0.255

   EIGRP配置 (交换机以SW1为例)

SW1 (configrouter eigrp 100

SW1 (config-router) #ip routing

SW1 (config-router) #network 192.168.2.0  0.0.0.255

SW1 (config-router) #network 192.168.90.0  0.0.0.255

SW1 (config-router) #passive-interface f0/2

九.浮动路由和静态路由配置(以R1为例)

R1 (config) #ip route 0.0.0.0 0.0.0.0  f0/1  100 送出接口

R1 (config) #ip route 0.0.0.0 0.0.0.0  s0/0/0  下一跳地址

十.PAT配置(以R2为例)

R2(config)#ip nat pool NAT 112.10.12.3 112.10.12.4 netmask 255.255.255.248//配置地址池和掩码

R2(config)#ip nat inside source list ACCESS pool NAT overload//配置NAT

十二.标准访问控制列表(ACL)配置(以R2为例)

R2(config) #access-list 2 permit 192.168.2.0  0.0.0.255 //只允许vlan2的网段访问

R2 (config) #access-list 2 deny any //止其他网段访问

R2 (config)#int s0/0/1

R2 (config-if)ip access-group 2 in

十一.SSH配置(以SW2为例)

SW2(config)#ip domain-name cisco //配置域名
SW2(config)#crypto key generate rsa  //加密密钥生成
SW2(config)#ip ssh version 2 //启用版本2
SW2(config)#username jw001 secret 888 用户名为jw001,密码为888
SW2(config)#line vty 0 15 进入vty进程
SW2(config-line)#transport input ssh 仅允许以SSH的方式登录
SW2(config-line)#exit

                                          综合一

1.设备初始化配置

hostname R1 改名

enable secret ciscocisco 设置特权加密密码

enable password cisco 设置特权明文密码

line console 0 进入consolo口

password 123 配置密码

exec-timeout 0 0 空闲时间永不超时

logging synchronus  设置日志同步

line vty 0  4 (交换机是0 15)进入vty线路

password 123 配置密码

exec-timeout 0 0 空闲时间永不超时

logging synchronus  设置日志同步

 

注意把网络中各个红色状态接口no shutdown打开

 

2.      单臂路由

(1.交换机配置)

Switch(config)#vlan 3 创建vlan 3

Switch(config)#name RSB 给vlan起名称

Switch(config)#vlan 4 创建vlan 4

Switch(config)#name CWB 给vlan起名称
Switch(config)#int f0/1
Switch(config-if)#switchport mode access 设置为接入模式
Switch(config-if)#switchport access vlan 3 将f0/2接口划分到vlan 3
Switch(config)#int f0/2
Switch(config-if)#switchport mode access 设置为接入模式
Switch(config-if)#switchport access vlan 4 将f0/3接口划分到vlan 4
Switch(config-if)#exit
Switch(config)#int f0/24
Switch(config-if)#switchport mode trunk 
Switch(config-if)#exit

(2.路由器配置)

R1(config)#int g0/0/0.3 直接进入.3子接口
Router(config-subif)#encapsulation dot1Q 3  封装vlan 3
Router(config-subif)#ip address 172.16.3.254 255.255.255.0   给接口配地址
Router(config-subif)#int g0/0/0.4  直接进入.4子接口
Router(config-subif)#encapsulation dot1Q 4 指定一个子接口为vlan 4的接口
Router(config-subif)#ip address 192.16.4.254 255.255.255.0 给接口配地址
Router(config-subif)#exit
Router(config)#interface g0/0/0 进大接口
Router(config-if)#no shutdown 开启接口

 R3路由器也需要配置单臂路由,只是子接口号、地址等信息不同,原理一样。

3.vtp配置(在交换机上)

SW1 上 :

vtp mode server

vtp domain ccna

vtp password cisco

int f0/24

switchport mode trunk

 

SW2和SW1原理一样,注意SW2模式为:vtp mode transparent

 

4.eigrp配置

router eigrp 1

no auto-summary

passive-interface f0/0

network 宣告直连网段 注意使用通配符掩码(反掩码)

 

5.配置浮动路由

R1:ip route 2.2.2.0 255.255.255.0 f0/1 100    送出接口的

R1:  ip route 2.2.2.0  255.255.255.0 192.168.12.2   下一跳地址的

R2:ip route 1.1.1.0 255.255.255.0 f0/1 100    送出接口的

R2:  ip route 1.1.1.0 255.255.255.0 192.168.12.1   下一跳地址的

 

6.配置loopback口地址

int loopback 0

ip address  1.1.1.1 255.255.255.0

 

7.在eigrp下宣告换回接口

network 1.1.1.0 0.0.0.255

R2和R3同理

宣告技巧:show ip route 查看路由表,看哪些是直连,就宣告直连。

loopback就属于环回接口,配置地址后也会在路由表中显示,所以一样需要宣告。

自己理解的(不准确):配置环回接口后,在路由表中会显示,相当于创建了一个网段,所以需要宣告

 

 

 

注意:给设备改名,配置各个接口的地址,配置pc的地址,子网掩码和默认网关都是加分的

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM