计算机网络四级配置
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、路由器配置
系统
工作
方式
1、进入特权模式
进入全局配制模式
进入端口配置模式
进入虚拟终端配置模式
RIP路由协议配置模式Router>enable Password:
Router#
Router>configure terminal Router(configure)#
Router(config)#int aaa/1 Router(configure-if)#
Router(config)#line vly 0 15 Router(configure-line)#
Router(config)#router rip Router(configure-router)#
系统基本信息检测与控制2、配置远程登密码
3、拷贝文件到TFTP Server
4、拷贝runing-config到TFTP
5、拷贝bootflash中的配置文件到
TFTP
6、拷贝TFTP Server上的配置文件到
路由器
7、拷贝TFTP上的Bootflash到flash
8、配置主机名
9、配置超级口令用户
10、设置系统时钟
11、保存设置
12、删除设置
13、基本检测命令
Router(config)#line vly 0 15
Router(config-line)#password 7 zzz307
Router#write newtwork
Router#copy runing-config tftp :
Router#copy bootflash : tftp
Router#copy tftp:runing-config
Router#copy tftp:bootflash
Router(config)r#hostname router-phy
Router(config)#enable secret phy123
Router(confg)#calendar set 24:14:00 march
2015
Router(config)#write memory
Router(config)#write erase
Router>telnet paris/222.34.27.1
Router>ping 182.105.130.110
14、flash、时钟、软硬件的查看、路由器配置、查看路由表、IP路由协议的详细Route>trace 137.189.73 Router>traceroute
Router>show flash
Router>sh clock
Router>sh version
Router>sh configuration Router>sh ip route
Router>sh ip protocols
接口
配置
15、配置端口信息
16、配置带宽
17、配置IP地址
18、接口开与关
19、不作ARP代理
20、配置异步串口通信接口
21、配置高速同步串行接口Router(config-if)>description to-beijing foreign studiens university
Router(config-if)>bandwidth 2500,000
Router(config-if)#ip address 202.112.7.249 255.255.255.252
Router(config-if)>no shoutdown
Router(config-if)>shoutdown
Router(config-if)#duplex full
#no ip drected-broadcast
#no ip roxy-arp
Router(config)#interface a1
Router(config-if)#ip unnumbered ethernet0 Router(config-if)#encapsulation ppp Router(config-if)#async dynamic routing Router(config-if)#async mode interactive Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router(confg)#
Router(config)#interface s1/1
Router(config-if)#description to-shenzhen Router(config-if)#bandwidth 2048
Router(config-if)#Ip address 212.112.41.81 255.255.255.252
Router(config-if)#encapsulation hdlc
22、配置POS接口
23、lookback接口配置
24、配置静态路由Router(config-if)#no ip direct-broadcast Router(config-if)#no ip proxy-arp
Router(config)#interface pos 3/0
Router(config-if)#description to tianjingdaxue
Router(config-if)#bandwidth 2500,000 Router(config-if)#ip address 212.12.37.18 255.255.255.252
Router(confg-if)#crc 32
Router(config-if)#pos framing sdh
Router(config-if)#no ip directed-broadcast Router(config-if)#pos flag s1 s0 2
Route(config)#int lookback 0
Route(config)#ip address 192.167.167.6 255.255.255.255
Route(config-if)#no ip route-cache
Route(config-if)#no ip mroute-cache
Route(config)#ip route 195.65.96.0 255.255.240.0 222.122.37.1(静态路由配置)
Rip动态路由配置25、进入RIP配置模式
26、参与rip协议的地址
27、配置RIP的被动接收
28、配置RIP的过滤
29、配置RIP的管理距离
30、配置RIP的邻居路由器
Router(config)#router rip
Router(config-router)#network 159.105.0.0
Router(config-router)#passive-interface
ethernet0
Router(config-router)#access-list 12 deny
any
Router(config-router)#router rip
Router(config-router)#distribute-list 12 in
ethernet0
Router(config-router)#distance 50
Router(config-router)#neighbor 202.112.7.2
OSPF
动态
路由
配置
31、配置单个IP地址参与OSPF
32、网络地址参与OSPF Router(config)#route ospf 63
Router(configprouter)#network 131.107.25 1.0.0.0 area 0
Router(config-router)#nework 133.181.0.0 0.255.255.255 area 0
33、定义参与OSPF的子网地址
34、配置被动接口(包括路由器的第三层交换机制配置)
35、配置路由过滤
36、配置管理距离
37、配置OSPF引入外部路由的花费值
38、配置引入外部路由的花费值
39、配置引入外部路由时缺省的外部路由类型Router(config-router)#area 0 range 212.37.123.0 255.255.255.0
Router(config-router)#passive-ingerface Ethernet 0
Router(config-router)#passive-interface vlan37)
Router(config)#access-list 12 deny any Router(config)#router ospf 63
Router(config-router)#distribute-list 12 in serial 0
Router(config-router)#distance 10
Router(config-router)#redistribute metric 100
Router(config-router)#redistribute tag 10
Router(config-router)#redistribute connect metric-type 1 subnet
DHCP
配置
40、配置地址池的名字
41、配置IP地址池的子网地址和子网
掩码
42、配置不用于动态分配的IP地址
43、配置IP地址池的缺省网关
44、配置IP地址池的域名
45、配置IP地址池的域名服务器的IP
地址
46、配置IP地址池的地址租用时间
47、取消IP地址冲突记录日志Router(config)#ip dhcp pool ttt/234
Router(dhcp-config)#network 201.23.98.0 255.255.255.0
Router(dhcp-config)#ip dhcp excluded-address 201.23.98.2 201.23.98.10
Router(dhcp-config)#default router 201.23.98.1
Router(dhcp-config)#domain name
Router(dhcp-config)#dns-server address 212.105.129.27 212.105.129.26
Router(dhcp-config)#lease 0 5/#lease infinite
Router(config)#no ip dhcp confilict logging
IP访问控制列表配置48、配置标准访问控制列表,配置应
用接口
49、查看访问控制列表/配置信息
只允许源址为211.105.30.0 0.0.0.255子网
的主机登录路由器
Router(config)#access-list 10 permit
211.105.130.0 0.0.0.255
Router(config)#line vty 0 5
Router(config-line)#access-class 10 in
Router#sh access-lists/show configuration
二、交换机配制
系统配置模式交换机配置命令Catalyst3548(ciscoIO
S)
Catalyst6500(catalyst
OS系统)
1、进入全局配置模式Switch-3548>enable
Password:********
Switch-3548#config t
Switch-3548(config)#
Swithc-6509>enable
Enter password:
Swithc-6509>(enable)
2、启用交换机HTTP Sever Switch-3548(config)#i
p http server
Swithc-6509>(enable)
set ip http server
enable
3、主机名Switch-3548(config)#
hostname
switch-PHY-3548
Swithc-6500>(enable)
set system name
Swithc-PHY-6500
Swithc-6500>(enable)
set prompt
Swithc-PHY-6500> 4、超级用户口令Switch-PHY-3548(con
fig)#enable secret 5
zzz
Switch-PHY-3548(con
fig)#enable password
zzz
Switch-PHY-3584(con
fig)#enable password
7 zzz
Swithc-PHY-6500>(e
nable)set enablepass
5、配置远程登陆口令Switch-PHY-3548(con
fig)#line vty 0 4
Swithc-PHY-3548(con
fig-line)#password
7zzz
Switch-PHY-3548(con
fig-line)#password 0
zzz
Swithc-PHY-3548(con
fig-line)#
Swithc-PHY-6500>(e
nable)set password 6、配置系统时间Switch-PHY-3548#clo Swithc-PHY-6500>(e
ck set 23:00:00 29 march 2015 nable)set time fri 3/29/2015 10:22:00
7、配置设备管理地址(IP地址及缺省路由)SwitchPHY-3548(conf
ig)#interface VLAN1
Swithc-PHY-3547(con
fig-if)#ip adress
203.105.1.62
Switch-PHY-3548(con
fig)#ip
default-geteway
203.105.1.1
Swithc-PHY-6500>(e
nable)set interface sc0
203.105.1.63
端口配置模式8、进入端口配置模式Switch-PHY-3548(con
fig)#interface f0/24
Swithc-6509>(enable)
9、配置端口描信息Switch-PHY-3548(con
fig-if)#description
To-lib
Swithc-PHY-6500>(e
nable)set port name
4/5 mail-server
10、配置交换机端口的关闭与开启Switch-PHY-3548(con
fig-if)#no
shoutdown/shoutdown
Swithc-PHY-6500>(e
nable)setport
enable/disable 4/5 11、配置端口的通信方式Switch-PHY-3548(con
fig-if)#duplex
auto/full/half
Swithc-PHY-6500>(e
nable)set port duplex
5/1 full/half
12、配置交换机端口的传输速率Switch-PHY-3548(con
fig-if)#speed
10/100/auto
Swithc-PHY-6500>(e
nable)setport speed
5/1-24
虚拟网配置13、配置VTP域名Switch-PHY-3548(con
fig)#vtp domain pku
Swithc-PHY-6500>(e
nable)set vtp domain
pku
14、配置VTP工作模式Switch-PHY-3548(con
fig)#vtp mode
server/client/transpare
nt
Swithc-PHY-6500>(e
nable)set vtp mode
server/client/transpare
nt/off
15、进入VLAN配置模式Switch-PHY-3548#vla
n data
Switch-6509>(enable)
16、建立VLAN Swithc-PHY-3548(vla
n)#vlan 1000 name
vlan1000
Swith-PHY-6500>(en
able)set vlan 999
name vlan999
17、删除VLAN Switch-PHY-3548(vla
n)#no vlan 1000
Switch-PHY-6500>(e
nable)clear vlan 999 18、修改VLAN Switch-PHY-3548(vla
n)#vlan 1000 name
v1000
Switch-PHY-6500>(e
nable)set vlan 999
name v999
19、为端口分配VLAN Switch-PHY-3548(con
fig-if)#switchport
Swithc-PHY-6500>(e
nable)set vlan 42 5/20
access vlan 248
20、配置VLAN Trunk模式Switch-PHY-3548(con
fig-if)#switchport
mode trunk Switch-PHY-6500>(e nable)set trunk 5/1 on dot1 qPort(s) 1/2 trunk mode set to on
21、封装VLAN协议Switch-PHY-3548(con
fig-if)#switchport
trunk encapsulation
dot1 q/is1/negotiate P
22、设置允许中继的VLAN Swithc-PHY-3548(con
fig-if)#switchport
trunk allowed vlan
10,14/10-14/except10
0-1000 Switch-PHY-6500>(e nable)set trunk 5/1 vlan 37-42
生成树配置23、打开或关闭STP Switch-PHY-3548(con
fig)#(no)spanning-tree
vlan 3
Switch-PHY-6500(ena
ble)set spantree
enable/disable
24、配置根网桥和备份根网桥Switch-PHY-3548(con
fig)#spanning-tree
vlan 3 root primary
secondary
Switch-PHY-6500>(e
nable)set spantree root
1,200-204
25、配置生成树优先级Switch-PHY-3548(con
fig)#spanning-tree
vlan 3 priority 8192
Swithc-PHY-6500>(e
nable)set spantree
priority 8 192
26、配置BackboneFast生成树可选功能Swithc-PHY-3548(con
fig)#spanning-tree
backbonefast
Swithc-PHY-6500>(e
nable)set spantree
backbonefast enable 27、配置UplinkFast生成树可选功能Swithc-PHY-3548(con
fig)#spanning-tree
uplinkfast
max-update-rate
32000
Swithc-PHY-3548(con
fig)#spanning-tree
uplinkfast
Swithc-PHY-6500>(e
nable)set spantree
uplinkfast enable
28、配置portFast生成树可选功能Switch-PHY-3548(con
fig)#spanning-tree
portfast default
Swithc-PHY-6500>(e
nable)set spantree
portfast 3/2 enable 29、配置BPDU Filter 生成树可选功能Swithc-PHY-3548(con
fig)#spanning-tree
portfast bpdufilter
default
Switch-PHY-6500>(e
nable)set spantree
portfast bpdu-filter
enable
三、Sniffer软件的信息意思
Sniffer pro 的Exper提供了大量强大的解码功能
Summary部分:显示状态,收发双方的地址、协议、长度、捕获时间
Details部分:显示在Summary中选定数据包的协议解码信息
Hex:部分:以十六进制和ASCII码显示被解码的数据载荷
四.路由表的填写
根据路由汇聚,同层大部分相同的IP即只变网络号的是网络号;变化大的不相同的则是主机号;路由表的填写要注意路由汇聚
如图:与S0直接相连的是172.0.147.169变成二进制为:172.0.147.1010 1001 与S1直接相边的是172.0.147.173变成二进制为:172.0.147.1010 1101
由此可以看出S0是0号网,S1是一号网,则子网掩码是:255.255.255.1010 1000即30位,与S0直接相连的网号是172.0.147.1010 10 00;同理与S1直接相连的网号是172.0.147.1010 11 00
同理由其它的不同层次的子网可以汇聚成不同的目标IP,主要是将同层IP不同的地方写二进制比较只有少部分不同的地方代表的是网络号,很大部分不同的地方且有一样的部分所在位是主机号所处的位数。