其他分享
首页 > 其他分享> > 思科实验笔记

思科实验笔记

作者:互联网

三种模式

用户模式>
特权模式#
全局配置模式conf

vlan

创建:valn 10
退出:exit

trunk

sw mo trunk

交换机

二层交换机

二层交换机进接口: int f0/1
创建:sw mo t
退出:exit

二层交换机划分vlan

二层交换机进接口:int f0/1
编辑接口模式:sw mo ac (可省略)
把vlan加入接口:sw ac vlan 10
退出: exit

三层交换机

实现路由功能1

三层交换机进接口:int vlan 10
给vlan10配ip:ip add 10.1.1.254 255.0.0.0
退出:exit
开启路由功能:ip routing

配trunk

三层交换机进接口:int f0/1
链路:sw trunk en d
配为trunk: sw mo tr

路由器

实现路由功能2

进虚接口:int f0/0.3
给接口划分vlan:en dot 30
配ip地址:ip add 30.1.1.254 255.0.0.0
退出:exit
进真实接口:int f0/0
重启: no sh

静态路由

凡是与路由器非直连的都要配路由

ACL 访问控制列表

分类:标准1-99;扩展100-199

标准ACL

conf t
acc 1 deny host 10.1.1.1 或 acc 1 deny 20.1.1.0 0.0.0.255
acc 1 permit any

将ACL应用到接口:(在接口应用一次就行)
int f0/x
ip access-group 表号 in/out
exit

扩展ACL

conf t
acc 100 permit tcp host 10.1.1.1 host 20.1.1.3 eq 80
acc 100 permit icmp host 10.1.1.1 20.1.1.0 0.0.0.255
acc 100 deny ip host 10.1.1.1 20.1.1.0 0.0.0.255
acc 100 permit ip any any

将ACL应用到接口:(在接口应用一次就行)
int f0/x
ip access-group 表号 in/out
exit

查看ACL表:
show ip access-list [表ID]

NAT 网络地址转换

分类:静态,动态,过载(PAT)

静态

配置
ip nat inside source static 192.168.10.1 76.12.16.139
ip nat inside source static tcp 192.168.20.1 80 76.12.16.140 80
开启端口(两个口都要配)
int f0/1
ip nat outside
int f0/0
ip nat inside
exit

动态
配置
access-list 1 permit 192.168.10.0 0.0.0.255
ip nat pool ziqiming 76.12.16.139 76.12.16.141 netmask 255.255.255.248
ip nat inside source list 1 pool ziqiming
开启端口(两个口都要配)
int f 0/1
ip nat outside
exit
int f 0/0
ip nat inside
exit

过载
定义内部地址池:
acc 1 permit 192.168.0.0 0.0.255.255
做PAT动态映射:
conf t
ip nat inside source list 1 int f0/1 overload
开启端口(两个口都要配)
int f 0/1
ip nat outside
exit
int f 0/0
ip nat inside
exit

查看ip地址转换
debug ip nat

标签:f0,思科,int,ip,笔记,实验,接口,nat,exit
来源: https://blog.csdn.net/qq_45151738/article/details/116504521