当前位置:文档之家› CISCO NAT配置命令

CISCO NAT配置命令

CISCO NAT配置命令
CISCO NAT配置命令

CISCO NAT 配置命令

21.1.在路由器上启用基本的NAT功能

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#access-list 15 permit 192.168.0.0 0.0.255.255

Router(config)#ip nat inside source list 15 interface FastEthernet0/0 overload

Router(config)#interface FastEthernet0/2

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface Ethernet0/0

Router(config-if)#ip address 172.16.1.5 255.255.255.252

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#end

Router#

注释例子中的配置实现了对地址段192.168.0.0/16访问外部网络重写为172.16.1.5的功能,基本的地址翻译功能

21.2. 动态分配外部地址

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#access-list 15 permit 192.168.0.0 0.0.255.255

Router(config)#ip nat pool NATPOOL 172.16.1.100 172.16.1.150 netmask 255.255.255.0

Router(config)#ip nat inside source list 15 pool NATPOOL

Router(config)#interface FastEthernet 0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface FastEthernet 0/1

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface Ethernet1/0

Router(config-if)#ip address 172.16.1.2 255.255.255.0

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#end

Router#

注释ip nat inside source list 15 pool NATPOOL 定义了翻译出去的地址池,如果地址池可以地址用完新的翻译将不成功,如果加上了overload参数将会从第一个地址开始翻译进行复用。另外这里的地址池并不一定要和outside端口的地址在同一网段,只要有相应的路由就可以。

21.3. 静态分配外部地址

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#ip nat inside source static 192.168.1.15 172.16.1.10 Router(config)#ip nat inside source static 192.168.1.16 172.16.1.11 Router(config)#interface FastEthernet 0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface FastEthernet 0/1

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface Ethernet1/0

Router(config-if)#ip address 172.16.1.2 255.255.255.0

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#end

Router#

21.4. 地址静态和动态翻译结合

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#access-list 15 deny 192.168.1.15 0.0.0.0

Router(config)#access-list 15 deny 192.168.1.16 0.0.0.0

Router(config)#access-list 15 permit 192.168.0.0 0.0.255.255

Router(config)#ip nat inside source static 192.168.1.15 172.16.1.10 Router(config)#ip nat inside source static 192.168.1.16 172.16.1.11 Router(config)#ip nat pool NATPOOL 172.16.1.100 172.16.1.150 netmask 255.255.255.0

Router(config)#ip nat inside source list 15 pool NATPOOL overload Router(config)#interface FastEthernet0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface Ethernet0/0

Router(config-if)#ip address 172.16.1.2 255.255.255.0

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#end

Router#

注释这里的控制列表把所要静态内部地址排除了,当然这一步也不是必须的,因为静态翻译的优先级要高于动态翻译的,不过静态翻译的外部地址必须要从动态翻译的地址池中排除。

21.5. 使用Route Maps来进行翻译规则控制

Router1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#interface FastEthernet0/0

Router(config-if)#ip address 172.16.1.5 255.255.255.252

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#ip address 172.16.2.5 255.255.255.252

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#interface FastEthernet0/2

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#exit

Router(config)#ip nat inside source route-map ISP-1 interface FastEthernet0/0 overload

Router(config)#ip nat inside source route-map ISP-2 interface FastEthernet0/1 overload

Router(config)#route-map ISP-1 permit 10

Router(config-route-map)#match interface FastEthernet0/0

Router(config-route-map)#exit

Router(config)#route-map ISP-2 permit 10

Router(config-route-map)#match interface FastEthernet0/1

Router(config-route-map)#exit

Router(config)#end

Router#

注释适用于多个outside端口的情况

21.6. 同时两个方向地址翻译

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#access-list 15 deny 192.168.1.15

Router(config)#access-list 15 permit 192.168.0.0 0.0.255.255

Router(config)#access-list 16 deny 172.16.5.25

Router(config)#access-list 16 permit 172.16.0.0 0.0.255.255

Router(config)#ip nat pool NATPOOL 172.16.1.100 172.16.1.150 netmask 255.255.255.0

Router(config)#ip nat pool INBOUNDNAT 192.168.15.100 192.168.15.200 netmask 255.255.255.0

Router(config)#ip nat inside source list 15 pool NATPOOL overload Router(config)#ip nat inside source list 16 pool INBOUNDNAT overload Router(config)#ip nat inside source static 192.168.1.15 172.16.1.10 Router(config)#ip nat outside source static 172.16.5.25 192.168.15.5 Router(config)#ip route 192.168.15.0 255.255.255.0 Ethernet0/0 Router(config)#interface FastEthernet 0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface FastEthernet 0/1

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#interface Ethernet0/0

Router(config-if)#ip address 172.16.1.2 255.255.255.0

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#end

Router#

21.7. 网络前缀重写简单的改变某个网络段的前缀

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip nat outside source static network 172.16.0.0 172.17.0.0 /16 no-alias

Router(config)#ip route 172.16.0.0 255.255.0.0 Ethernet1/0 Router(config)#ip route 172.17.0.0 255.255.0.0 Ethernet1/0 Router(config)#interface FastEthernet 0/0

Router(config-if)#ip address 10.1.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface Ethernet1/0

Router(config-if)#ip address 172.16.1.6 255.255.255.252

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#end

Router#

注释适用于两个网络互访而地址段冲突的情况

21.8. 使用NAT来进行服务器负荷分担

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface FastEthernet0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#ip nat pool WEBSERVERS 192.168.1.101 192.168.1.105 netmask 255.255.255.0 type rotary

Router(config)#access-list 20 permit host 192.168.1.100

Router(config)#ip nat inside destination list 20 pool WEBSERVERS Router(config)#end

Router#

注释这里不同点在于使用了rotary的参数和使用了destination而不是source在翻译规则中,当然这种是穷人的负载均衡解决方案

21.9. 基于状态的NAT切换

RouterA

Router-A#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router-A(config)#access-list 11 permit any

Router-A(config)#ip nat pool NATPOOL 172.17.100.100 172.17.100.150 netmask 255.255.255.0

Router-A(config)#ip nat inside source list 11 pool NATPOOL mapping-id 1 Router-A(config)#interface FastEthernet0/0

Router-A(config-if)#ip address 192.168.1.3 255.255.255.0

Router-A(config-if)#ip nat inside

Router-A(config-if)#standby 1 ip 192.168.1.1

Router-A(config-if)#standby 1 preempt

Router-A(config-if)#standby 1 name SNATGROUP

Router-A(config-if)#exit

Router-A(config)#interface Serial0/0

Router-A(config-if)#ip address 172.17.55.2 255.255.255.252

Router-A(config-if)#ip nat outside

Router-A(config-if)#exit

Router-A(config)#ip nat Stateful id 1

Router-A(config-ipnat-snat)#redundancy SNATGROUP

Router(config-ipnat-snat-red)#mapping-id 1

Router(config-ipnat-snat-red)#exit

Router-A(config)#end

Router-A#

RouterB

Router-B#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router-B(config)#access-list 11 permit any

Router-B(config)#ip nat pool NATPOOL 172.17.100.100 172.17.100.150 netmask 255.255.255.0

Router-B(config)#ip nat inside source list 11 pool NATPOOL mapping-id 1 Router-B(config)#interface FastEthernet0/0

Router-B(config-if)#ip address 192.168.1.2 255.255.255.0

Router-B(config-if)#ip nat inside

Router-B(config-if)#standby 1 ip 192.168.1.1

Router-B(config-if)#standby 1 priority 90

Router-B(config-if)#standby 1 preempt

Router-B(config-if)#standby 1 name SNATGROUP

Router-B(config-if)#exit

Router-B(config)#interface Serial0/0

Router-B(config-if)#ip address 172.17.55.6 255.255.255.252

Router-B(config-if)#ip nat outside

Router-B(config-if)#exit

Router-B(config)#ip nat Stateful id 1

Router-B(config-ipnat-snat)#redundancy SNATGROUP

Router(config-ipnat-snat-red)#mapping-id 1

Router(config-ipnat-snat-red)#exit

Router-B(config)#end

Router-B#

注释虽然说通过使用HSRP可以解决可用性的问题,但是不能同步NAT翻译表,从12.2(13)T以后思科引入了基于状态的NAT(SNAT),这样可以保持两台设备的翻译表同步,其关键命令为ip nat Stateful 要注意的是这里的Stateful是大写开头的,这里是区分大小写的。另外SNAT只和HSRP连用,不能跟VRRP或者GLBP一起作用。同时也可以使用多组HSRP的形式来保持负载均衡。

21.10. 调整NAT 时长

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#ip nat translation tcp-timeout 500

Router(config)#ip nat translation udp-timeout 30

Router(config)#ip nat translation dns-timeout 30

Router(config)#ip nat translation icmp-timeout 30

Router(config)#ip nat translation finrst-timeout 30

Router(config)#ip nat translation syn-timeout 30

Router(config)#end

Router#

也可以限制翻译表的最大条目数

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip nat translation max-entries 1000

Router(config)#end

Router#

注释缺省TCP为24小时,UDP为5分钟,DNS为1分钟

21.11. 修改FTP的TCP端口

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#access-list 19 permit 192.168.55.5

Router(config)#ip nat service list 19 ftp tcp port 8021

Router(config)#ip nat service list 19 ftp tcp port 21

Router(config)#end

Router#

注释在12.2(4)T后思科引入了no-payload关键词来防止对数据包载荷的地址信息进行修改

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface FastEthernet0/0

Router(config-if)#ip address 172.16.1.5 255.255.255.252

Router(config-if)#ip nat outside

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#ip nat inside

Router(config-if)#exit

Router(config)#ip nat inside source static 192.168.1.10 172.16.1.5 no-payload

Router(config)#end

Router#

21.12. 检查NAT状态

Router#show ip nat translation

Router#clear ip nat translation *

Router#clear ip nat translation inside 172.18.3.2

Router#clear ip nat translation outside 192.168.1.10

Router#show ip nat statistics

Router#clear ip nat statistics

注释

Router#show ip nat translation

Pro Inside global Inside local Outside local Outside global

"Inside global" 为内部设备翻译的地址"Inside local"为内部设备的真实地址"Outside local" 为外部设备翻译的地址"Outside global" 为外部设备的真实地址,global addresses在outside, local addresses 在inside.

21.13.NAT排错

Router#debug ip nat

Router#debug ip nat detailed

Router#debug ip nat 15

Router#debug ip nat 15 detailed

思科交换机命令大全

思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询:? 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr 查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.2 全局配置模式 进入全局配置模式:Switch#configure terminal

主机名修改:Switch(config)#hostname 主机名(自选参数) 特权模式进入密码: Switch(config)#enable secret 密码(自选参数) 取消特权模式密码:Switch(config)#no enable secret 取消主机名设置: Switch(config)#no hostname 退出配置模式: Switch(config)#exit 需要特别注意的是在配置模式中无法使用show命令,如果要使用 的话show前必须加do和空格,例如:do show * 指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary 例如: Switch(config)#spanning-tree vlan 1 root primary 需要注意的是:设置根交换机是基于VLAN的 关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号) 例如: Switch(config)#no spanning-tree vlan 1 1.3 接口配置模式 进入接口配置模式:Switch(config)#interface 端口名称(可选参数) 启用端口:Switch(config-if)#no shutdown 停用端口:Switch(config-if)#shutdown 进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5 进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2

Cisco设备的基本配置命令

switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)#

HC交换机基本配置命令

H C交换机基本配置命令 IMB standardization office【IMB 5AB- IMBK 08- IMB 2C】

H3C交换机基本配置核心交换机——作为公司核心网络的主要中枢,合理的配置 1.认证方式为Scheme时的Telnet登录配置 discu查看当前配置 [h3c]telnetserverenable射端口方式 b.出端口方式 1)低端H3C交换机远程端口镜像的配置,如S3100、S5510、S5600: ◆充当源交换机时的配置 remote-probevlanenable//将当前VLAN配置为远程镜像VLAN mirroringstp-collaboration//(可选)开启端口镜像与STP联动功能,开启该功能后,设备将通过监测端口的STP状态来自动控制该端口上的镜像功能是否生效。 mirroring-group group-id remote-source//创建远程源镜像组 mirroring-group group-id mirroring-port mirroring-port-list{both|inbound|outbound}//配置远程端口镜像源端口 mirroring-group group-id reflector-port reflector-port//为远程镜像组配置反射端口mirroring-group group-id remote-probevlan remote-probe-vlan-id //为指定远程源镜像组配置远程镜像VLAN ◆充当中间交换机时的配置 remote-probevlanenable//定义当前VLAN配置为远程镜像VLAN ◆充当目的交换机的配置 remote-probevlanenable//定义当前VLAN配置为远程镜像VLAN

cisco配置命令大全

933a LMI使用Q933A标准.LMI(Local management Interface)有3种:ANSI:T1.617;CCITTY:Q933A和CISCO特有的标准。 # fram-relay intf-typ ABC ABC为帧中继设备类型,它们分别是DTE设备,DCE交换机或NNI(网络接点接口)支持。# frame_relay interface_dlci 110 br 配置DLCI(数据链路连接标识符)。 # frame-relay map ip ABCD XXXX broadcast 建立帧中继映射。ABCD为对方ip地址,XXXX为本地DLCI号,broadcast允许广播向前转发或更新路由。 # no shutdown 激活本端口. # exit ---- 5 .帧中继子接口的配置: # conf t # int s0.1 point-to-point

对应S0的子接口1,点对点方式。 # ip addr ABCD XXXX ABCD为子口1的IP地址,XXXX为子网掩码。# frame-relay intreface-dlci 100 br 6.配置拨号备份 (1).配置备份主口 # conf t # int s0 S0为主口. # backup int asy 1 A1口为备份口. # backup delay 0 1 延时1秒. (2).配置虚拟接口 # conf t # ip addr ABCD XXXX

ABCD为虚拟接口IP地址,XXXX为子网掩码。 # encap ppp 封装ppp协议. # dialer in-band 激活随叫随拨功能. # dialer idle-timeout 7200 # dialer map ip ABCD modem-script call broadcast 6225481 br 映射对应的拨号口.ABCD为对方拨号口的ip地址,6225481为对应的电话号码。 # dialer_group 1 定义拨号组成员. (3).配置防火墙 # dialer_list 1 pro ip permit 允许ip协议通过。 (4).配置连接口令 # user name ABCD pass XXXX ABCD为对方主机名,XXXX为连接口令. (5).配置拨号字符串

cisco交换机(Switch)配置命令大全

1.在基于IOS的交换机上设置主机名/系统名: switch(config)# hostname hostname 在基于CLI的交换机上设置主机名/系统名: switch(enable) set system name name-string 2.在基于IOS的交换机上设置登录口令: switch(config)# enable password level 1 password 在基于CLI的交换机上设置登录口令: switch(enable) set password switch(enable) set enalbepass 3.在基于IOS的交换机上设置远程访问: switch(config)# interface vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address 在基于CLI的交换机上设置远程访问: switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlan switch(enable) set ip route default gateway 4.在基于IOS的交换机上启用和浏览CDP信息: switch(config-if)# cdp enable switch(config-if)# no cdp enable

为了查看Cisco邻接设备的CDP通告信息: switch# show cdp interface [type modle/port] switch# show cdp neighbors [type module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/number description-string 6.在基于IOS的交换机上设置端口速度: switch(config-if)# speed{10|100|auto} 在基于CLI的交换机上设置端口速度: switch(enable) set port speed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto} 7.在基于IOS的交换机上设置以太网的链路模式: switch(config-if)# duplex {auto|full|half} 在基于CLI的交换机上设置以太网的链路模式: switch(enable) set port duplex module/number {full|half}

实验三 交换机配置方式及基本命令的熟悉文档

实验三交换机配置方式及基本命令的熟悉 【实验目的】 通过对交换机设备的几种配置手段、配置模式和基本配置命令的认识,获得交换机的基本使用能力。 【实验任务】 1、认识交换机的配置方式。 2、按照给出的参考拓扑图构建逻辑拓扑图。 3、按照给出的配置参数表配置各个设备。 4、练习交换机的一些基本命令。 建议实验学时:2学时。 【实验背景】 在前面的实验中我们已经接触了Cisco的路由器运行的Cisco互联网络操作系统(ISO,Internetwork Operating System),熟悉了Cisco IOS软件内置的命令行界面(CLI,command-line interface)。同样,交换机可以通过一个菜单驱动程序的界面,或者通过命令行界面(CLI),或者在交换机配置了IP地址后通过Telnet远程登录、web登录的方式对交换机来进行配置。 交换机除了可以通过Console端口与计算机直接连接外,还可以通过交换机的普通端口进行连接。如果是堆叠型的,也可以把几台交换机一起进行配置,因为实际上这个时候它们是一个整体,这时通过普通端口对交换机进行管理时,就不再使用超级终端了,而是以Telnet 虚拟终端或Web浏览器的方式实现与被管理交换机的通信。前提是在本地配置方式中已为交换机配置好了IP地址,我们可通过IP地址与交换机进行通信,不过要注意,只有是网管型的交换机才具有这种管理功能。实际上最常用的Catalyst交换机OS被称为Catalyst OS、CatOS,其最大的特点是基于set 命令。但我们常用的是与路由器的IOS相类似的基于IOS 的Catalyst OS。下面简单介绍交换机的各种命令模式以及各种常用的命令。 表4.1交换机的各种命令模式的访问方式、提示符、退出方法及其描述

1-cisco路由器基本配置及远程登录

实训目的: (1)学习和掌握科路由器的配置方式和要求。 (2)学习和掌握科路由器的工作模式分类、提示符、进入方式。1、路由器的配置方式 ①超级终端方式。该方式主要用于路由器的初始配置,路由器不需要IP地址。基本方法是:计算机通过COM1/COM2口和路由器的Console口连接,在计算机上启用“超级终端”程序,设置“波特率:9600 ,数据位:8,停止位:1,奇偶校验: 无,校验:无”即可。常用 ②Telnet方式。该方式配置要求路由器必须配置了IP地址。基本方法是:计算机通过网卡和路由器的以太网接口相连,计算机的网卡和路由器的以太网接口的IP地址必须在同一网段。常用 ③其他方式:AUX口接MODEM,通过电话线与远方运行终端仿真软件的微机;通过Ethernet上的TFTP服务器;通过Ethernet上的SNMP网管工作站。 2、路由器的工作模式 在命令行状态下,主要有以下几种工作模式: ①一般用户模式。主要用于查看路由器的基本信息,只能执行少数命令,不能对路由 器进行配置。提示符为:Router>;进入方式为:Telnet或Console ②使能(特权)模式。主要用于查看、测试、检查路由器或网络,不能对接口、路由 协议进行配置。提示符为:Router#;进入方式为:Router>enable。 ③全局配置模式。主要用于配置路由器的全局性参数。提示符为:Router(config)#; 进入方式为:Router#config ter。 ④全局模式下的子模式。包括:接口、路由协议、线路等。其进入方式和提示符如下: Router(config)#ineterface e0 //进入接口模式 Router(config-if)#//接口模式提示符 Router(config)#rip //进入路由协议模式 Router(config-router)# //路由协议模式 Router(config)#line con 0 //进入线路模式

h3c系统基本配置命令

第1章系统基本配置命令 1、1 系统基本配置命令 1、1、1 clock datetime 【命令】 clock datetime time date 【视图】 用户视图 【参数】 time:当前时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM与SS取值范围为0~59。 date:为当前日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM得取值范围为1~12,DD得取值范围与月份有关,YYYY得取值范围为2000~2035。 【描述】 clock datetime命令用来设置系统时间与日期。 在需要严格获取绝对时间得应用环境中,必须设定设备当前日期与时钟。在输入时间参数时,可以不输入秒。 设置完成后,可以使用display clock命令进行查瞧。 【举例】 # 设置设备当前日期为2005年8月1日14时10分20秒。 clock datetime 14:10:20 08/01/2005 1、1、2 clock summer-time 【命令】 clock summer-time zone-name one-off start-time start-date end-time end-date offset-time clock summer-time zone-name repeating { start-time start-date end-time end-date | start-time start-year start-month start-week start-day end-time end-year end-month end-week end-day } offset-time undo clock summer-time 【视图】 用户视图 【参数】 zone-name:夏令时名称,为1~32个字符得字符串,区分大小写。one-off:表示仅对某一年得夏令时时间进行设置。

cisco交换机常用配置命令

3、常用配置命令 3.1 把端口加入到vlan Switch>en Password: Switch #conf t /*进入配置模式*/ Enter configuration commands, one per line. End with CNTL/Z. Switch (config)#inter f 0/1 /*进入端口*/ Switch (config-if)#switchport access vlan X /*把端口加入到vlan X*/ Switch (config-if)#end Switch #wr /*保存*/ Building configuration... [OK] Switch # 3.2 添加新vlan(在核心交换机上写) Switch>en Password: Switch #conf t /*进入配置模式*/ Enter configuration commands, one per line. End with CNTL/Z. Switch (config)#Vlan X /*添加新Vlan*/ Switch (config-vlan)#inter vlan X /*进入Vlan*/ Switch (config-if)#ip address x.x.x.x 255.255.255.0/*设置vlan ip地址*/ Switch (config-if)#no shut 3.3 配置trunk,透传vlan Switch>en Password: Switch #conf t /*进入配置模式*/ Enter configuration commands, one per line. End with CNTL/Z. Switch (config)#inter fast 0/x /*进入级联端口*/ Switch (config-if)#switchport mode trunk /*修改端口模式*/ Switch (config-if)# switchport trunk allowed vlan all /*设置允许通过的vlan*/ 保存 删除命令:所有的命令前面加no。

思科交换机路由器命令大全

思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020

1. 交换机支持的命令:交换机基本状态: 交换机口令设置: switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口 令switch(config)#enable password xxa ;设置特权非 密口令switch(config)#line console 0 ;进入控制台 口switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令 xxswitch#exit ;返回命令 交换机VLAN设置:

switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端 口1switch(config-if)#switchport access vlan 2 ; 当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式 交换机设置IP地址: 交换机显示命令:

思科基本配置命令详解

思科交换机基本配置实例讲解

目录 1、基本概念介绍............................................... 2、密码、登陆等基本配置....................................... 3、CISCO设备端口配置详解...................................... 4、VLAN的规划及配置........................................... 4.1核心交换机的相关配置..................................... 4.2接入交换机的相关配置..................................... 5、配置交换机的路由功能....................................... 6、配置交换机的DHCP功能...................................... 7、常用排错命令...............................................

1、基本概念介绍 IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lan VTP: VLAN TRUNK PROTOCOL DHCP: 动态主机配置协议 ACL:访问控制列表 三层交换机:具有三层路由转发能力的交换机 本教程中“#”后的蓝色文字为注释内容。 2、密码、登陆等基本配置 本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。 Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory. Processor board ID 00000000 R4700 CPU at 100MHz, Implementation 33, Rev 1.2

迈普路由器配置手册 系统基础

InfoExpress IOS InfoExpress l l l l 1.1 l console shell l 56/336modem LINE l Telnet l SNMP console 56/336modem LINE Telnet SNMP 1.2 InfoExpress IOS shell l l l Console Telnet l shell

InfoExpress IOS Shell l user EXEC l privileged EXEC l global configuration l interface configuration l router configuration l file system configuration l access list configuration l voice-port configuration l dial-peer configuration l crypto transform-set configuration l crypto map configuration l IKE isakmp configuration l pubkey-chain configuration l pubkey-key configuration l DHCP dhcp configuration 1-1 1-1 InfoExpress Lo en co in ro um

IP phone E1 filesystem router(config-fs)# exit ip access-list router(config-std-nacl)# cl)# voice-port ro rt) dial-peer router(config-dial-peer )# exit V oIP POTS crypto ipsec transform-set router(cfg-crypto-trans )# exit crypto map router(cfg-crypto-map) # exit IKE crypto isakmp router(config-isakmp)# crypto key pubkey-chain rsa router(config-pubkey-c hain)# exit RSA

思科路由器基本配置与常用配置命令

思科路由器基本配置与常用配置命令(simple for CCNA) 启动接口,分配IP地址: router> router> enable router# router# configure terminal router(config)# router(config)# interface Type Port router(config-if)# no shutdown router(config-if)# ip address IP-Address Subnet-Mask router(config-if)# ^z 配置RIP路由协议:30秒更新一次 router(config)# router rip router(config-if)# network Network-Number router(config-if)# ^z 配置IGRP路由协议:90秒更新一次 router(config)# router igrp AS-Number router(config-if)# network Network-Number router(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次 router(config)# ipx routing [node address] router(config)# ipx maximum-paths Paths router(config)# interface Type Port router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR: router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number] router(config)# interface bri 0 router(config-if)# dialer-group Group-Number router(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN: router(config)# isdn swith-type Swith-Type router(config-if)# ^z 配置Frame Relay: router(config-if)# encapsulation frame-relay [cisco | ietf ] router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] router(config-if)# bandwidth kilobits router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ] router(config-if)# ^z配置标准ACL: router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ] router(config)# interface Type Port router(config-if)# ip access-group Access-List-Number [ in | out ] router(config-if)# ^z配置扩展ACL: router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]

H3C交换机常用配置命令

H3C交换机常用配置命令 一、用户配置 system-view [H3C]super password H3C 设置用户分级密码 [H3C]undo super password 删除用户分级密码 [H3C]localuser bigheap 123456 1 Web网管用户设置,1(缺省)为管理级用户,缺省admin,admin [H3C]undo localuser bigheap 删除Web网管用户 [H3C]user-interface aux 0 只支持0 [H3C-Aux]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟 [H3C-Aux]undo idle-timeout 恢复默认值 [H3C]user-interface vty 0 只支持0和1 [H3C-vty]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟 [H3C-vty]undo idle-timeout 恢复默认值 [H3C-vty]set authentication password 123456 设置telnet密码,必须设置[H3C-vty]undo set authentication password 取消密码 [H3C]display users 显示用户 [H3C]display user-interface 显示用户界面状态 二、系统IP设置 [H3C]vlan 20 [H3C]management-vlan 20 [H3C]interface vlan-interface 20 创建并进入管理VLAN [H3C]undo interface vlan-interface 20 删除管理VLAN接口 [H3C-Vlan-interface20]ip address 192.168.1.2 255.255.255.0 配置管理VLAN接口静态IP地址(缺省为192.168.0.234) [H3C-Vlan-interface20]undo ip address 删除IP地址

Cisco交换机常用配置命令

Cisco交换机常用配置命令 CISCO交换机基本配置 switch>ena 進入特权模式 switch#erasenvram 全部清除交换机的所有配置 switch#reload 重新启动交换机(初始提示符为switch> ) ------------------------------------------------------------------------------------ CISCO交换机基本配置:Console端口连接 用户模式hostname>; 特权模式hostname(config)# ; 全局配置模式hostname(config-if)# ; 交换机口令设置: switch>enable ;进入特权模式 switch#config;进入全局配置模式 switch(config)#hostname cisco ;设置交换机的主机名 switch(config)#enable secret csico1 ;设置特权加密口令 switch(config)#enable password csico8 ;设置特权非密口令 switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;虚拟终端允许登录 switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6 switch#write 保存配置設置 switch#copy running-config startup-config 保存配置設置,與write一樣switch#exit;返回命令 配置终端过一会时间就会由全局配置模式自动改为用户模式,将超时设置为永不超时 switch#conf t switch(config)#line con 0 switch(config-line)#exec-timeout 0 --------------------------------------------------------------------------------- 交换机显示命令: switch#write;保存配置信息 switch#showvtp;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#showvlan;查看vlan配置信息 switch#showvlan name vlan2 switch#show interface ;查看端口信息

思科2960交换机配置命令

思科2960交换机配置命令 交换机的端口工作模式一般可以分为三种:Access(普通模式),Multi(多vlan模式),Trunk(中继模式)。1、允许多个vlan的是multi模式,而不是trunk 模式。2、两个都设为trunk模式:一:如果在同一交换机上,则决不会在同一vlan;二:如果是两个交换机上,且两端口物理连接的话,共享vlan信息。但是这两个端口已经被使用,所以只能说,使用与这两个端口相同vlan的端口的计算机是同一虚拟局域网。3、access和multi模式下,端口用于计算机;trunk 模式下,端口用于交换机间连接。所以access和trunk没有可比性。 交换机基本状态: switch ;ROM状态,路由器是rommon hostname ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置: switchenable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口令 switch(config)#enable password xxa ;设置特权非密口令 switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令

华为交换机基本配置命令29908

华为交换机基本配置命令 一、单交换机VLAN划分 命令命令解释 system 进入系统视图 system-view 进入系统视图 quit 退到系统视图 undo vlan 20 删除vlan 20 sysname 交换机命名 disp vlan 显示vlan vlan 20 创建vlan(也可进入vlan 20) port e1/0/1toe1/0/5 把端口1-5放入VLAN 20 中 5700系列 单个端口放入VLAN [Huawei]intg0/0/1 [Huawei]port link-typeaccess(注:接口类型access,hybrid、trunk) [Huawei]port default vlan 10 批量端口放入VLAN [Huawei]port-group 1 [Huawei-port-group-1]group-member ethernet G0/0/1 to ethernet G0/0/20 [Huawei-port-group-1]port hybrid untagged vlan 3 删除group(组)vlan 200内的15端口 [Huawei]intg0/0/15 [Huawei-GigabitEthernet0/0/15]undo port hybrid untagged vlan 200 通过group端口限速设置 [Huawei]Port-group 2 [Huawei]group-member g0/0/2 to g0/0/23 [Huawei]qos lr outbound cir 2000 cbs 20000 disp vlan 20 显示vlan里的端口20 int e1/0/24 进入端口24 undo port e1/0/10 表示删除当前VLAN端口10 disp curr 显示当前配置 return 返回 Save 保存 info-center source DS channel 0 log state off trap state off通过关闭日志信息命令改变DS模块来实现(关闭配置后的确认信息显示) info-center source DS channel 0 log state on trap state on 通过打开日志信息命令改变DS模块来实现(打开配置后的确认信息显示)

思科路由器常用配置命令大全

思科路由器常用配置命令大全 本文按字母顺序列举了思科路由器常用配置命令,适合思科路由器操作人员随时查看 Access-enable允许路由器在动态访问列表中创建临时访问列表入口 Access-group把访问控制列表(ACL)应用到接口上 Access-list定义一个标准的IP ACL Access-template在连接的路由器上手动替换临时访问列表入口 Appn向APPN子系统发送命令 Atmsig 执行ATM信令命令 B 手动引导操作系统 Bandwidth 设置接口的带宽 Banner motd 指定日期信息标语 Bfe 设置突发事件手册模式 Boot system 指定路由器启动时加载的系统映像 Calendar 设置硬件日历 Cd 更改路径 Cdp enable 允许接口运行CDP协议 Clear 复位功能 Clear counters 清除接口计数器 Clear interface 重新启动接口上的件逻辑 Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率 Cmt 开启/关闭FDDI连接管理功能 Config-register 修改配置寄存器设置 Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息 Configure memory 从NVRAM加载配置信息 Configure terminal 从终端进行手动配置 Connect 打开一个终端连接 Copy 复制配置或映像数据 Copy flash tftp 备份系统映像文件到TFTP服务器 Copy running-config startup-config 将RAM中的当前配置存储到NVRAM Copy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上 Copy tftp flash 从TFTP服务器上下载新映像到Flash Copy tftp running-config 从TFTP服务器上下载配置文件 Debug 使用调试功能 Debug dialer 显示接口在拨什么号及诸如此类的信息 Debug ip rip 显示RIP路由选择更新数据 Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息 Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息 Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程 Debug ppp 显示在实施PPP中发生的业务和交换信息 Delete 删除文件 Deny 为一个已命名的IP ACL设置条件 Dialer idle-timeout 规定线路断开前的空闲时间的长度 Dialer map 设置一个串行接口来呼叫一个或多个地点 Dialer wait-for-carrier-time 规定花多长时间等待一个载体 Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制 Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控

相关主题
文本预览
相关文档 最新文档