思科Packet Tracer---基本指令操作

路由器配置指令

-------命令指令解释
查看指令
基本指令enable
conf t
hostname Branch-B更改主机名为Branch-B
line vty 0 15虚拟通道密码 telnet设置
password cisco
login
line console 0
password cisco
login
exit
enable secret class
service password-encryption明文密码加密
banner motd #warnning#日志为warnning
copy running-config startup-config保存配置
Ipv4配置int g0/0进入g0/0的接口
ip address 172.20.16.1 255.255.254.0
Ipv6配置int g0/0
ipv6 address 2001:DB8:FADE:FF::1/64IPv6 地址
ipv6 address FE80::B link-local本地链路地址
ip route 192.168.1.0 255.255.255.0 192.168.10.1静态路由配置
ip route 0.0.0.0 0.0.0.0 192.168.10.1默认路由配置
ip route 0.0.0.0 0.0.0.0 Serial0/0/0配置直连默认路由
ip route 192.168.1.0 255.255.255.0 192.168.10.1 50浮动路由配置
ip route 0.0.0.0 0.0.0.0 192.168.10.1 50

OSPF配置

-------命令指令解释
OSPF配置OSPF例程
router ospf 1进程 ID 1
router-id 1.1.1.1路由器 ID 1.1.1.1
network 10.1.1.0 0.0.0.255 area 1通告 路由器上 OSPF 中的每个直连网络
passive-interface g0/0.15禁用不应发送 OSPF 消息的接口
log-adjacency-changes
default-information originate
ipv6 unicast-routing
ipv6 router ospf 1

VLAN配置

-------命令指令解释
VLAN配置VLAN例程
int vlan 88
ip add 172.31.88.4 255.255.255.0
ip default-gateway 172.31.88.1
vlan 10创建vlan 10
name Sales
int rang f0/7-12
sw mod acc
sw acc vl 10
int f0/22
sw mod tr
sw tr native vl 99本征vlan
sw tr allowed vl 10,20,30,88,99限制 TRUNK 只允许 VLAN 10、20、30、88 和 99
int f0/1在 Fa0/1 上,当检测到 MAC 地址时,允许 2 个 MAC 地址自动添加到配置文件中。不应禁用端口,但当发生违规时,应捕获 syslog 消息
sw mod acc
sw port-security
sw port-security max 2
sw port-security mac-address sticky
sw port-security violation restrict

dot1Q配置

-------命令指令解释
dot1Q配置dot1q例程
Interface g0/1.10
Encapsulation dot1q 10
Ip address 172.17.10.1 255.255.255.0
int g0/0.45
en dot1q 45 native
ip add 10.10.10.129 255.255.255.240

DHCP配置

命令指令解释
DHCP配置
Ip dhcp pool name1
Network 172.17.10.0 255.255.255.0将每个池中的默认路由器配置为子接口地址
Default-router 172.17.10.1
Ip dhcp exclude 172.17.10.1 172.17.17.20排除 VLAN 的前 20 个地址

配置远程管理访问

命令指令解释
配置远程管理访问NAT例程
ip domain-name cisco.com域为 cisco.com
username CAdmin password itsasecret用户 CAdmin ,密码为 itsasecret
crypto key generate rsa加密密钥长度为 1024
这句为电脑显示How many bits in the modulus [512]: 1024

SSH配置

命令指令解释
SSH配置ip ssh version 2SSH 第 2 版
ip ssh authentication-retries 2限制为 2 次身份验证尝试
ip ssh time-out 6060 秒的超时时间

NAT配置

命令指令解释
NAT配置
access-list 1 permit 10.10.10.0 0.0.0.255配置一个只含一条语句,编号为 1 的标准 ACL。允许所有属于 10.10.10.0/24 地址空间的 IP 地址
ip nat pool TEST 198.133.219.128 198.133.219.129 netmask 255.255.255.252
ip nat inside source static 10.10.10.162 198.133.219.130
ip nat inside source list 1 pool TEST overload
int g0/0.60
ip nat inside

EIGRP

命令指令解释
EIGRP例程
Route eigrp 1使用自治系统 1在路由器上实施 EIGRP
Network 172.31.0.0为环回接口使用有类网络地址
Network 172.31.6.0 0.0.0.3使用通配符掩码来传播 网络
使用默认方法来仅允许活动 EIGRP 串行接口发出的 EIGRP 更新以下两行
Passive-interface default//设置所有被动接口
No passive-interface s0/0/0//将直连的接口取消被动接口
No auto-summary不应总结通告
配置直连默认路由并在 EIGRP 更新中传播它
Ip route 0.0.0.0 0.0.0.0 s0/1/0
Router ei 1
Redistribute static
配置 路由器之间的串行接口,使其每 10 秒发送一个 hello
int s0/0/0
ip hello eigrp 1 10
配置环回网络的 EIGRP 总结路由
Int s0/0/0
Ip summary-address eigrp 1 172.31.0.0 255.255.254.0
Sh ip ro ei查看语句
IPv6 的 EIGRP
Ipv6 unicast-routing打开IPV6协议
ipv6 router eigrp 1使用自治系统 1 在路由器上实施 EIGRP
eigrp router-id 1.1.1.1ID 1.1.1.1
Int s0/0/0配置直连默认路由并在 EIGRP 更新中传播它
Ipv6 eigrp 1
Ipv6 route ::/0 s0/1/0

帧中继

命令指令解释
帧中继encapsulation frame-relay接口模式下,接口封装帧中继
frame-relay lmi-type ansi配置接口的LMI类型
int s0/0/0.2 point-to-point
ip add 10.1.1.1 255.255.255.252
frame-relay interface-dlci 102

PPP

命令指令解释
encapsulation ppp配置 HQ 以便在通向 Internet 的链路上使用带有 CHAP 的 PPP。ISP 是路由器主机名。CHAP 的密码为cisco。
ppp auth chap
user ISP pass cisco

ACL

命令指令解释
access-list 101 permit tcp 192.168.30.0 0.0.0.255 any eq www允许 192.168.30.0/24 网络上的主机通过 Web 访问任意目的地。
access-list 101 permit icmp 192.168.30.0 0.0.0.255 any允许 192.168.30.0/24 网络上的主机通过 ping 访问任意目的地。
access-list 101 deny ip any any拒绝来自网络的任何其它访问
ip access-list extended FIREWALL由于 ISP 提供通往 Internet 的连接,因此请按照下列顺序配置名为 FIREWALL 的命名 ACL
permit tcp host 192.168.1.10 host 192.168.20.254 eq www允许 TW-DSL 通过 Web 访问 Intranet 服务器
permit icmp any any echo-reply仅允许来自 ISP 和来自 ISP 之外任何源地址的入站 ping 应答。(echo-reply)
permit tcp any any established仅允许来自 ISP 和来自 ISP 之外任何源地址的已建立 TCP 会话。
deny ip any any明确阻止来自 ISP 和来自 ISP 之外任何源地址的所有其它入站访问。
ip access-group FIREWALL in //或者 ip access-group 101 in接口模式下

交换机

-------命令指令解释
ipv4配置interface vlan 1
ip address 192.168.1.100 255.255.255.0
no shutdown
ip default-gateway 192.168.2.254配置默认网关
PVST+配置
Span mod rapid-pvst配置快速 PVST+
Spanning-tree vlan 30 root primary
Spanning-tree vlan 10,20 root secondary
VLANvlan例程
ip route 172.31.10.0 255.255.255.0 Serial0/0/0配置直连静态路由
ip route 209.165.200.0 255.255.255.224 Serial0/1/1 10配置接口且 AD 为 10 的备份路由
启用端口安全int rang f0/11-24
switchport port-security
switchport port-security maximum 1每个端口只允许 1 台主机
switchport port-security violation shutdown确保在发生端口违规时禁用端口
switchport port-security mac-address sticky启用动态学习,将 MAC 地址存储在运行配置中
spanning-tree portfast配置 PortFast 和 BPDU 防护
spanning-tree bpduguard enable
中继和 EtherChannelint f0/1
channel-group 3 mode active为指向 S1 的 TRUNK 使用信道组 3
  • 5
    点赞
  • 46
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值