考CCNA必看:Cisco路由配置语句汇总
添加时间: 2008-2-24 11:31:06 作者: Cisco指导 阅读次数:105 来源: http://www.d9soft.com
interface Tunnel0
ip address 192.168.1.2 255.255.255.0
tunnel source 202.102.1.6
tunnel destination 202.102.1.5
crypto map cmap
!
-------以下设置内网口------
interface Ethernet0
ip address 10.1.2.1 255.255.255.0
!
-------以下设置外网口------
interface serial0
ip address 202.102.1.6 255.255.255.0
no ip mroute-cache
no fair-queue
crypto map cmap
!
ip classless
!
-------以下建立访问列表111------
access-list 111 permit ip host 202.102.1.5 host 202.102.1.6
access-list 111 permit ip host 202.102.1.6 host 202.102.1.5
access-list 111 permit ip 10.1.1.0 0.0.0.255 202.102.1.0 0.0.0.255
access-list 111 permit ip 10.1.2.0 0.0.0.255 202.102.1.0 0.0.0.255
access-list 111 permit ip 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255
access-list 111 permit ip 10.1.2.0 0.0.0.255 10.1.1.0 0.0.0.255
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
!
vlan 配置思路
在交换机上创建vlan
1.建立一个vtp 管理 域
×为了在交换机上创建vlan,必须首先建立一个vtp管理域以使它能够核验 网络
上当前的vlan
×Catalyst 4000 系列交换机模块只支持802.1q。
×判断硬件是否支持干道,及硬件所支持的干道封装使用:show port
capabilities
首先运行 clear config all
vtp command:
在基于IOS的交换机上配置VTP管理域或加入一个管理域:
switch# vlan database
switch(vlan)# vtp domain domain-name
在基于CLI的交换机上配置VTP管理域:
switch(enable) set vtp [domain domain-name] passwd password
在基于IOS的交换机上配置VTP 模式:
switch# vlan database
switch(vlan)# vtp domain domain-name
switch(vlan)# vtp {sever|cilent|transparent}
switch(vlan)# vtp password password
在基于CLI的交换机上配置VTP 模式:
switch(enable) set vtp [domain domain-name] [mode{
sever|cilent|transparent }][password password]
核验vtp的配置:
show vtp domain
show vtp statistics
在基于IOS的交换机上配置VTP版本:
×VTP版本1是缺省配置
switch# vlan database
switch(vlan)# vtp v2-mode
在基于CLI的交换机上配置VTP版本:
switch(enable) set vtp v2 enable
在基于IOS的交换机上启动VTP剪裁:
switch# vlan database
switch(vlan)# vtp pruning
在基于CLI 的交换机上启动VTP剪裁:
switch(enable) set vtp pruning enable
(set vtp pruneeligible vlan-range)
不起用vtp修剪:
clear vtp pruneeligible vlan-range
核验vtp修剪的配置:
show trunk
2.创建Vlan
在基于IOS的交换机上配置静态VLAN:
switch# vlan database
switch(vlan)# vlan vlan-num name vlan-name
switch(vlan)# exit
switch# configure teriminal
switch(config)# interface interface module/number
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan vlan-num
switch(config-if)# end
在基于CLI的交换机上配置静态VLAN:
switch(enable) set vlan vlan-num [name name]
switch(enable) set vlan vlan-num mod-num/port-list
核验配置:show vlan
3.配置干道链路
干道是在两台catalyst交换机端口或catalyst交换机与路由器间的一条点对点
链路。
干道链路可以承载多个vlan。
在基于IOS的交换机上配置干道链路
switch(config)# interface interface mod/port
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk encapsulation {isl|dotlq}
switch(config-if)# switchport trunk allowed vlan remove vlan-list
switch(config-if)# switchport trunk allowed vlan add vlan-list
说了这么多,下面给出一个配置实例供大家参考。
Welcome to the PIX firewall
Type help or '?' for a list of available commands.
PIX525> en
Password:
PIX525#sh config
: Saved
:
PIX Version 6.0(1) ------ PIX当前的操作系统版本为6.0
Nameif ethernet0 outside security0
Nameif ethernet1 inside security100 ------ 显示目前pix只有2个接口
Enable password 7Y051HhCcoiRTSQZ encrypted
Passed 7Y051HhCcoiRTSQZ encrypted ------ pix防火墙密码在默认状态下已被加密,在配置文件中不会以明文显示,telnet 密码缺省为cisco
Hostname PIX525 ------ 主机名称为PIX525
Domain-name 123.com ------ 本地的一个域名服务器123.com,通常用作为外部访问
Fixup protocol ftp 21
Fixup protocol http 80
fixup protocol h323 1720
fixup protocol rsh 514
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol sip 5060 ------ 当前启用的一些服务或协议,注意rsh服务是不能改变端口号
names ------ 解析本地主机名到ip地址,在配置中可以用名字代替ip地址,当前没有设置,所以列表为空
pager lines 24 ------ 每24行一分页
interface ethernet0 auto
interface ethernet1 auto ------ 设置两个网卡的类型为自适应
mtu outside 1500
mtu inside 1500 ------ 以太网标准的MTU长度为1500字节
ip address outside 61.144.51.42 255.255.255.248
ip address inside 192.168.0.1 255.255.255.0 ------ pix外网的ip地址61.144.51.42,内网的ip地址192.168.0.1
ip audit info action alarm
ip audit attack action alarm ------ pix入侵检测的2个命令。当有数据包具有攻击或报告型特征码时,pix将采取报警动作(缺省动作),向指定的日志记录主机产生系统日志消息;此外还可以作出丢弃数据包和发出tcp连接复位信号等动作,需另外配置。
pdm history enable ------ PIX设备 管理 器可以图形化的监视PIX
arp timeout 14400 ------ arp表的超时时间
global (outside) 1 61.144.51.46 ------ 如果你访问外部论坛或用QQ聊天等等,上面显示的ip就是这个
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside, outside) 61.144.51.43 192.168.0.8 netmask 255.255.255.255 0 0
conduit permit icmp any any
conduit permit tcp host 61.144.51.43 eq www any
conduit permit udp host 61.144.51.43 eq domain any
------ 用61.144.51.43这个ip地址提供domain-name服务,而且只允许外部用户访问domain的udp端口
route outside 0.0.0.0 0.0.0.0 61.144.51.61 1 ------ 外部网关61.144.51.61
timeout xlate 3:00:00 ------ 某个内部设备向外部发出的ip包经过翻译(global)后,在缺省3个小时之后此数据包若没有活动,此前创建的表项将从翻译表中删除,释放该设备占用的全局地址
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h323 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute ------ AAA认证的超时时间,absolute表示连续运行uauth定时器,用户超时后,将强制重新认证
aaa-server TACACS+ protocol tacacs+
aaa-server RADIUS protocol radius ------ AAA服务器的两种协议。AAA是指认证,授权,审计。Pix防火墙可以通过AAA服务器增加内部 网络 的 安全
no snmp-server location
no snmp-server contact
snmp-server community public ------ 由于没有设置snmp工作站,也就没有snmp工作站的位置和联系人
no snmp-server enable traps ------ 发送snmp陷阱
floodguard enable ------ 防止有人伪造大量认证请求,将pix的AAA资源用完
no sysopt route dnat
telnet timeout 5
ssh timeout 5 ------ 使用ssh访问pix的超时时间
terminal width 80
Cryptochecksum:a9f03ba4ddb72e1ae6a543292dd4f5e7
PIX525#
PIX525#write memory ------ 将配置保存
上面这个配置实例需要说明一下,pix防火墙直接摆在了与internet接口处,此处网络环境有十几个公有ip,可能会有朋友问如果我的公有ip很有限怎么办?你可以添加router放在pix的前面,或者global使用单一ip地址,和外部接口的ip地址相同即可。另外有几个维护命令也很有用,show interface查看端口状态,show static查看静态地址映射,show ip查看接口ip地址,ping outside | inside ip_address确定连通性。
考CCNA必看:Cisco路由配置语句汇总(4) 第 [1] [2] [3] [4] [5] 下一页
上一篇文章: VPN实例配置方案:IPSec配置 下一篇文章: 考CCNA必看:FrameRelay

