思科路由器配置vlan
思科路由器命令大全(完整版)

思科路由器命令大全(完整版)思科路由器命令大全(完整版)本文档旨在提供思科路由器命令的详细说明和使用指南,包括路由器配置、网络管理、安全性设置等内容。
每个章节都详细介绍了不同的命令和参数,以帮助用户更好地理解和使用思科路由器。
1:路由器基本配置1.1 主机名设置1.2 用户名和密码设置1.3 IP 地址和子网掩码配置1.4 默认网关配置2:接口配置2.1 以太网接口配置2.2 串行接口配置2.3 子接口配置2.4 虚拟局域网 (VLAN) 配置3:路由协议配置3.1 静态路由配置3.2 动态路由配置3.2.1 RIP 配置3.2.2 OSPF 配置3.2.3 BGP 配置4:网络管理4.1 SNMP 配置4.2 NetFlow 配置4.3 Syslog 配置4.4 路由器时间设置5:安全性配置5.1 访问控制列表 (ACL) 配置5.2 VPN 配置5.3 防火墙配置5.4 AAA 配置附件:本文档附带的附件包括示例配置文件、命令输出示例等,以帮助读者更好地理解和应用文档中的内容。
法律名词及注释:本文档所涉及的法律名词及其注释如下:1:主机名:指路由器的主机标识名称,用于在网络中识别路由器。
2:用户名和密码:用于登录和管理路由器的凭证信息。
3: IP 地址:网络协议中用于唯一标识设备的数字地址。
4:子网掩码:用于标识 IP 地址中网络部分和主机部分的分界线。
5:默认网关:用于转发网络流量的下一跳路由器。
6:以太网接口:用于连接局域网设备的物理接口。
7:串行接口:用于连接广域网设备的物理接口。
8:子接口:在一个物理接口上创建多个逻辑接口,用于实现VLAN 分隔等功能。
9:虚拟局域网 (VLAN):用于将局域网划分成多个逻辑网络的技术。
10:静态路由:手动配置的路由表项,用于指定数据包传输的路径。
11:动态路由:根据路由协议动态学习和更新的路由表项,用于自动路由选择。
12: RIP:路由信息协议,一种距离向量路由协议。
思科路由器如何配置VLAN的IP

思科路由器如何配置VLAN的IP我们的思科路由器如何配置VLAN的IP呢?想必很多网络技术的新手都不清楚,所以小编这里就推荐下配置VLAN的IP方法和介绍VLAN给你们认识认识。
VLAN:英文全称为Virtual Local Area Network,中文称虚拟局域网,VLAN其实就相当于一个小型网络的统称,如校园网内有三个不同网段,分别为10.0.0.0、172.16.1.0和192.168.1.0,我们可以分别将这三个网段划分为三个不同的VLAN,以便于管理。
举个例子,只允许10.0.0.0网段访问172.16.1.0网段,不能访问192.168.1.0网段,此时VLAN的好处显露无疑。
今天笔者同大家分享思科路由器如何配置VLAN的IP。
1、启动计算机并连接到思科路由器,进入VLAN配置模式。
在命令行提示符下键入以下命令,然后按ENTER键host1(config)#interface fastEthernet 4/0请注意,在这个例子中,我们指定的VLAN使用的是快速以太网连接,标有“快速以太网”。
2、对VLAN进行封装,输入以下命令:host1(config-if)#encapsulation vlan3、创建一个子接口的VLAN,这将主机的IP,通过添加一个子识别号码。
键入以下命令,然后按ENTER键。
host1(config-if)#interface fastEthernet 4/0.354、指定的VLAN ID,通过键入以下命令Read more: How to Configure a VLAN IP | "host1(config-if)#vlan id 333",5、分配给VLAN的IP地址,在命令提示符下键入以下命令,然后按回车键。
host1(config-if)#IP address 192.168.1.13 255.255.255.0通过这5个命令,你就成功在路由器上的VLAN配置了IP地址了,是不是很简单呢。
cisco RV 120W 路由器配置成VLAN交换机

思科RV 120W 路由器配置成小型交換機1、使用網線把電腦和交換機LAN1或其他LAN口相連接。
2、打開IE流覽器輸入192.168.1.1(新交換機默認IP)。
3、在下圖中輸用戶名:admin,密碼為admin或為空(默認)點擊Log In 登錄。
用戶登錄4、思科RV 120W設置界面如下:5、設置路由訪問IP和關閉DHCP:設置路由訪問IP選擇DHCP是否關閉6、關閉無線網絡,進入以下界面。
無線開啟狀態顯示7、選擇要更改的無線網AP,點擊Edit,進入設置無線網絡是否開啟界面:8、重設用戶名和密碼:9、新建VLAN勾選為開啟,取消勾選為關閉修改用戶名稱修改密碼保存已建好VLAN點Add 添加VLAN10、點Add 添加VLAN輸入VALN描述名稱ID編號名稱保存11、輸入VALN描述名稱和ID編號(根據實際情況自己設定),點Save保存。
12、設置VLAN IP地址和子網掩码13、選擇要編輯的VLAN號,點擊Edit。
14、修改后關閉DHCP點擊保存。
15、VLAN端口分配:已設定VLAN IP地址勾選要編輯的VLAN ID點擊Edit修改VLAN IP地址和子網掩码修改VLANIP地址和子選擇DHCP是否關閉端口分配狀態勾選要編輯的端口,點擊Edit16、選擇要編輯的端口,點擊Edit端口類型選擇設定其端口要開放的VLAN ID編號17、先選擇端口類型(Trunk用于交換機级联,General為一般通用接口,Aceess用于設定開放VLAN對象),保存,選擇端口類型后選要開放的VLAN ID編號,保存。
思科7960路由器如何配置Voicevlan

思科7960路由器如何配置Voice vlan思科是全球高端顶尖的通讯厂商,他出产的路由器功能也是世界级的,那么你知道思科7960路由器如何配置Voice vlan吗?下面是店铺整理的一些关于思科7960路由器如何配置Voice vlan的相关资料,供你参考。
思科7960路由器配置Voice vlan的方法:cisco7960 P1连接3550 F0/5端口用IEEE 802.1Qframes标准端口承载语音流量switchconf tmls qosvlan 2name accessexitvlan 3name voiceexitinterface f0/5mls qos trust cosswitchport mode accessswitchport access vlan 3switchport voice vlan 2end校验SW2#sh int fast 0/5 switchportName: Fa0/5Switchport: EnabledAdministrative Mode: static accessOperational Mode: static accessAdministrative Trunking Encapsulation: negotiateOperational Trunking Encapsulation: nativeNegotiation of Trunking: OffAccess Mode VLAN: 2 (access)Trunking Native Mode VLAN: 1 (default)Voice VLAN: 3 (vioce)Administrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: ALLPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledAppliance trust: noneSW2#sh spanning-tree interface f 0/5 portfastVLAN0002 enabled配置VOICE VLAN的802.1P priority-taged frames标准配置端口承载运因流量。
思科4506路由器全网络配置方案

思科4506全网络配置方案1. 网络拓扑2. 配置文档中心机房配置2台Catalyst4506,互为冗余备份,通过一台PIX525防火墙连接互联网。
接入交换机配置Catalyst3750/3560,每台接入交换机配置2条TRUNK端口,分别连接到核心交换机。
整个网络部署9个Vlan,Vlan1为管理vlan,其余8个Vlan为用户Vlan。
每个用户Vlan分配一个C类ip地址段,其中x.x.x.1为网关,x.x.x.1-x.x.x.99保留为手动ip配置,x.x.x.100-x.x.x.254作为dhcp动态分配的Vlan用户使用。
(1)主核心交换机Catalyst4506配置。
SW4500-1#SW4500-1#wr tBuilding configuration...Current configuration : 9687 bytes!version 12.2no service padservice timestamps debug uptimeservice timestamps log uptimeno service password-encryptionservice compress-config!hostname SW4500-1!boot-start-markerboot system flash bootflash:cat4500-ipbase-mz.122-31.SGA6.bin boot-end-marker!enable secret cisco!no aaa new-modelip subnet-zerono ip domain-lookupip host fw 192.168.201.100ip host sw2 192.168.201.3ip dhcp excluded-address 192.168.202.1 192.168.202.99ip dhcp excluded-address 192.168.203.1 192.168.203.99ip dhcp excluded-address 192.168.204.1 192.168.204.99ip dhcp excluded-address 192.168.205.1 192.168.205.99ip dhcp excluded-address 192.168.206.1 192.168.206.99ip dhcp excluded-address 192.168.207.1 192.168.207.99ip dhcp excluded-address 192.168.208.1 192.168.208.99ip dhcp excluded-address 192.168.209.1 192.168.209.99ip dhcp excluded-address 192.168.210.1 192.168.210.99ip dhcp excluded-address 192.168.201.1 192.168.201.20ip dhcp excluded-address 192.168.201.100 192.168.201.126 !ip dhcp pool vlan2network 192.168.202.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.202.1lease 0 8!ip dhcp pool vlan3network 192.168.203.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.203.1lease 0 8!ip dhcp pool vlan4network 192.168.204.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.204.1lease 0 8!ip dhcp pool vlan5network 192.168.205.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.205.1lease 0 8!ip dhcp pool vlan6network 192.168.206.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.206.1lease 0 8!ip dhcp pool vlan7network 192.168.207.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.207.1lease 0 8!ip dhcp pool vlan8network 192.168.208.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.208.1lease 0 8!ip dhcp pool vlan9network 192.168.209.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.209.1lease 0 8!ip dhcp pool vlan10network 192.168.210.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.210.1lease 0 8!ip dhcp pool vlan1network 192.168.201.0 255.255.255.128 dns-server 202.99.224.8 202.106.0.20default-router 192.168.201.1lease 0 8!!!!power redundancy-mode redundantno file verify auto!spanning-tree mode pvstspanning-tree extend system-idspanning-tree vlan 1-10 priority 24576!vlan internal allocation policy ascending!interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface GigabitEthernet2/1description LinkToSW4500-2 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet2/2switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet2/3 switchport mode trunk!interface GigabitEthernet2/4 switchport mode trunk!interface GigabitEthernet2/5 switchport mode trunk!interface GigabitEthernet2/6 switchport mode trunk!interface GigabitEthernet2/7 switchport mode trunk!interface GigabitEthernet2/8 switchport mode trunk!interface GigabitEthernet2/9 switchport mode trunk!interface GigabitEthernet2/10 switchport mode trunk!interface GigabitEthernet2/11 switchport mode trunk!interface GigabitEthernet2/12 switchport mode trunk!interface GigabitEthernet2/13 switchport mode trunk!interface GigabitEthernet2/14 switchport mode trunk!interface GigabitEthernet2/15 switchport mode trunk!interface GigabitEthernet2/16 switchport mode trunk!interface GigabitEthernet2/17 switchport mode trunk!interface GigabitEthernet2/18 switchport mode trunk!interface GigabitEthernet3/1 description LinkToFirewall switchport mode access spanning-tree portfast!interface GigabitEthernet3/2 switchport mode access spanning-tree portfast!interface GigabitEthernet3/3 description Cisco net manager switchport mode access spanning-tree portfast!interface GigabitEthernet3/4 switchport mode access spanning-tree portfast!interface GigabitEthernet3/5 switchport mode access spanning-tree portfast!interface GigabitEthernet3/6 switchport mode access spanning-tree portfast!interface GigabitEthernet3/7 switchport mode access spanning-tree portfast!interface GigabitEthernet3/8 switchport mode access spanning-tree portfast!interface GigabitEthernet3/9 switchport mode access spanning-tree portfastinterface GigabitEthernet3/10 switchport mode access spanning-tree portfast!interface GigabitEthernet3/11 switchport mode access spanning-tree portfast!interface GigabitEthernet3/12 switchport mode access spanning-tree portfast!interface GigabitEthernet3/13 switchport mode access spanning-tree portfast!interface GigabitEthernet3/14 switchport mode access spanning-tree portfast!interface GigabitEthernet3/15 switchport mode access spanning-tree portfast!interface GigabitEthernet3/16 switchport mode access spanning-tree portfast!interface GigabitEthernet3/17 switchport mode access spanning-tree portfast!interface GigabitEthernet3/18 switchport mode access spanning-tree portfast!interface GigabitEthernet3/19 switchport mode access spanning-tree portfast!interface GigabitEthernet3/20 switchport mode access spanning-tree portfastinterface GigabitEthernet3/21 switchport mode access spanning-tree portfast!interface GigabitEthernet3/22 switchport mode access spanning-tree portfast!interface GigabitEthernet3/23 switchport mode access spanning-tree portfast!interface GigabitEthernet3/24 switchport mode access spanning-tree portfast!interface GigabitEthernet3/25 switchport mode access spanning-tree portfast!interface GigabitEthernet3/26 switchport mode access spanning-tree portfast!interface GigabitEthernet3/27 switchport mode access spanning-tree portfast!interface GigabitEthernet3/28 switchport mode access spanning-tree portfast!interface GigabitEthernet3/29 switchport mode access spanning-tree portfast!interface GigabitEthernet3/30 switchport mode access spanning-tree portfast!interface GigabitEthernet3/31 switchport mode access spanning-tree portfastinterface GigabitEthernet3/32 switchport mode accessspanning-tree portfast!interface GigabitEthernet3/33!interface GigabitEthernet3/34!interface GigabitEthernet3/35!interface GigabitEthernet3/36!interface GigabitEthernet3/37!interface GigabitEthernet3/38!interface GigabitEthernet3/39!interface GigabitEthernet3/40!interface GigabitEthernet3/41 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/42 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/43 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/44 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/45 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/46 switchport trunk encapsulation dot1q switchport mode trunkinterface GigabitEthernet3/47switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/48switchport trunk encapsulation dot1q switchport mode trunk!interface Vlan1ip address 192.168.201.2 255.255.255.128 standby 1 ip 192.168.201.1standby 1 preempt!interface Vlan2ip address 192.168.202.2 255.255.255.0 standby 1 ip 192.168.202.1standby 1 preempt!interface Vlan3ip address 192.168.203.2 255.255.255.0 standby 1 ip 192.168.203.1standby 1 preempt!interface Vlan4ip address 192.168.204.2 255.255.255.0 standby 1 ip 192.168.204.1standby 1 preempt!interface Vlan5ip address 192.168.205.2 255.255.255.0 standby 1 ip 192.168.205.1standby 1 preempt!interface Vlan6ip address 192.168.206.2 255.255.255.0 standby 1 ip 192.168.206.1standby 1 preempt!interface Vlan7ip address 192.168.207.2 255.255.255.0 standby 1 ip 192.168.207.1standby 1 preempt!interface Vlan8ip address 192.168.208.2 255.255.255.0standby 1 ip 192.168.208.1standby 1 preempt!interface Vlan9ip address 192.168.209.2 255.255.255.0standby 1 ip 192.168.209.1standby 1 preempt!ip route 0.0.0.0 0.0.0.0 192.168.201.100ip http server!!!snmp-server community public-nm ROsnmp-server community private-nm RWsnmp-server chassis-id snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart snmp-server enable traps ttysnmp-server enable traps fru-ctrlsnmp-server enable traps entitysnmp-server enable traps flash insertion removalsnmp-server enable traps cpu thresholdsnmp-server enable traps vtpsnmp-server enable traps vlancreatesnmp-server enable traps vlandeletesnmp-server enable traps envmon fan shutdown supply temperature statussnmp-server enable traps port-securitysnmp-server enable traps rfsnmp-server enable traps config-copysnmp-server enable traps configsnmp-server enable traps hsrpsnmp-server enable traps ipmulticastsnmp-server enable traps mac-notification change move thresholdsnmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message snmp-server enable traps bridge newroot topologychangesnmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency snmp-server enable traps syslogsnmp-server enable traps vlan-membershipsnmp-server host 192.168.201.101 public-nm!control-plane!!line con 0stopbits 1line vty 0 4password ciscologin!endSW4500-1# sh cdp neiCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDSW4500-2 Gig 2/1 136 R S I WS-C4506 Gig 2/1 bangonglou2 Gig 3/48 162 S I WS-C3750G Gig 1/0/23 bangonglou1 Gig 3/47 126 S I WS-C3750G Gig 1/0/23SW4500-1#sw2Trying sw2 (192.168.201.3)... OpenUser Access VerificationPassword:SW4500-2>enPassword:SW4500-2#wr tBuilding configuration...Current configuration : 9011 bytes!version 12.2no service padservice timestamps debug uptimeservice timestamps log uptimeno service password-encryptionservice compress-config!hostname SW4500-2!boot-start-markerboot system flash bootflash:cat4500-ipbase-mz.122-31.SGA6.binboot-end-marker!enable secret 5 $1$qdQu$9POGVGQrtfz7hMOiRKf/k.!no aaa new-modelip subnet-zerono ip domain-lookupip host sw1 192.168.201.2ip dhcp excluded-address 192.168.202.1 192.168.202.99ip dhcp excluded-address 192.168.203.1 192.168.203.99ip dhcp excluded-address 192.168.204.1 192.168.204.99ip dhcp excluded-address 192.168.205.1 192.168.205.99ip dhcp excluded-address 192.168.206.1 192.168.206.99ip dhcp excluded-address 192.168.207.1 192.168.207.99ip dhcp excluded-address 192.168.208.1 192.168.208.99ip dhcp excluded-address 192.168.209.1 192.168.209.99ip dhcp excluded-address 192.168.210.1 192.168.210.99ip dhcp excluded-address 192.168.201.1 192.168.201.20ip dhcp excluded-address 192.168.201.100 192.168.201.126 !ip dhcp pool vlan2network 192.168.202.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.202.1lease 0 8!ip dhcp pool vlan3network 192.168.203.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.203.1lease 0 8!ip dhcp pool vlan4network 192.168.204.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.204.1lease 0 8!ip dhcp pool vlan5network 192.168.205.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.205.1lease 0 8!ip dhcp pool vlan6network 192.168.206.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.206.1lease 0 8!ip dhcp pool vlan7network 192.168.207.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.207.1lease 0 8!ip dhcp pool vlan8network 192.168.208.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.208.1lease 0 8!ip dhcp pool vlan9network 192.168.209.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.209.1lease 0 8!ip dhcp pool vlan10network 192.168.210.0 255.255.255.0dns-server 202.99.224.8 202.106.0.20default-router 192.168.210.1lease 0 8!ip dhcp pool vlan1network 192.168.201.0 255.255.255.128 dns-server 202.99.224.8 202.106.0.20default-router 192.168.201.1lease 0 8!!!!power redundancy-mode redundantno file verify auto!spanning-tree mode pvstspanning-tree extend system-idspanning-tree vlan 1-10 priority 28672 !vlan internal allocation policy ascending !interface GigabitEthernet1/1!interface GigabitEthernet1/2!interface GigabitEthernet2/1 description LINkToSW4500-1 switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet2/2!interface GigabitEthernet2/3!interface GigabitEthernet2/4!interface GigabitEthernet2/5!interface GigabitEthernet2/6!interface GigabitEthernet2/7!interface GigabitEthernet2/8!interface GigabitEthernet2/9!interface GigabitEthernet2/10!interface GigabitEthernet2/11!interface GigabitEthernet2/12!interface GigabitEthernet2/13!interface GigabitEthernet2/14!interface GigabitEthernet2/15!interface GigabitEthernet2/16!interface GigabitEthernet2/17interface GigabitEthernet2/18 !interface GigabitEthernet3/1 description LinkToFirewall switchport mode access spanning-tree portfast!interface GigabitEthernet3/2 switchport mode access spanning-tree portfast!interface GigabitEthernet3/3 description Cisco net manager switchport mode access spanning-tree portfast!interface GigabitEthernet3/4 switchport mode access spanning-tree portfast!interface GigabitEthernet3/5 switchport mode access spanning-tree portfast!interface GigabitEthernet3/6 switchport mode access spanning-tree portfast!interface GigabitEthernet3/7 switchport mode access spanning-tree portfast!interface GigabitEthernet3/8 switchport mode access spanning-tree portfast!interface GigabitEthernet3/9 switchport mode access spanning-tree portfast!interface GigabitEthernet3/10 switchport mode access spanning-tree portfastinterface GigabitEthernet3/11 switchport mode access spanning-tree portfast!interface GigabitEthernet3/12 switchport mode access spanning-tree portfast!interface GigabitEthernet3/13 switchport mode access spanning-tree portfast!interface GigabitEthernet3/14 switchport mode access spanning-tree portfast!interface GigabitEthernet3/15 switchport mode access spanning-tree portfast!interface GigabitEthernet3/16 switchport mode access spanning-tree portfast!interface GigabitEthernet3/17 switchport mode access spanning-tree portfast!interface GigabitEthernet3/18 switchport mode access spanning-tree portfast!interface GigabitEthernet3/19 switchport mode access spanning-tree portfast!interface GigabitEthernet3/20 switchport mode access spanning-tree portfast!interface GigabitEthernet3/21 switchport mode access spanning-tree portfastinterface GigabitEthernet3/22 switchport mode access spanning-tree portfast!interface GigabitEthernet3/23 switchport mode access spanning-tree portfast!interface GigabitEthernet3/24 switchport mode access spanning-tree portfast!interface GigabitEthernet3/25 switchport mode access spanning-tree portfast!interface GigabitEthernet3/26 switchport mode access spanning-tree portfast!interface GigabitEthernet3/27 switchport mode access spanning-tree portfast!interface GigabitEthernet3/28 switchport mode access spanning-tree portfast!interface GigabitEthernet3/29 switchport mode access spanning-tree portfast!interface GigabitEthernet3/30 switchport mode access spanning-tree portfast!interface GigabitEthernet3/31 switchport mode access spanning-tree portfast!interface GigabitEthernet3/32 switchport mode access spanning-tree portfastinterface GigabitEthernet3/33!interface GigabitEthernet3/34!interface GigabitEthernet3/35!interface GigabitEthernet3/36!interface GigabitEthernet3/37!interface GigabitEthernet3/38!interface GigabitEthernet3/39!interface GigabitEthernet3/40!interface GigabitEthernet3/41switchport trunk encapsulation dot1q switchport mode trunk!interface GigabitEthernet3/42!interface GigabitEthernet3/43!interface GigabitEthernet3/44!interface GigabitEthernet3/45!interface GigabitEthernet3/46!interface GigabitEthernet3/47!interface GigabitEthernet3/48!interface Vlan1ip address 192.168.201.3 255.255.255.128 standby 1 ip 192.168.201.1standby 1 priority 95standby 1 preempt!interface Vlan2ip address 192.168.202.3 255.255.255.0 standby 1 ip 192.168.202.1standby 1 priority 95standby 1 preempt!interface Vlan3ip address 192.168.203.3 255.255.255.0 standby 1 ip 192.168.203.1standby 1 priority 95standby 1 preempt!interface Vlan4ip address 192.168.204.3 255.255.255.0 standby 1 ip 192.168.204.1standby 1 priority 95standby 1 preempt!interface Vlan5ip address 192.168.205.3 255.255.255.0 standby 1 ip 192.168.205.1standby 1 priority 95standby 1 preempt!interface Vlan6ip address 192.168.206.3 255.255.255.0 standby 1 ip 192.168.206.1standby 1 priority 95standby 1 preempt!interface Vlan7ip address 192.168.207.3 255.255.255.0 standby 1 ip 192.168.207.1standby 1 priority 95standby 1 preempt!interface Vlan8ip address 192.168.208.3 255.255.255.0 standby 1 ip 192.168.208.1standby 1 priority 95standby 1 preempt!interface Vlan9ip address 192.168.209.3 255.255.255.0 standby 1 ip 192.168.209.1standby 1 priority 95standby 1 preempt!ip route 0.0.0.0 0.0.0.0 192.168.201.100ip http server!!!snmp-server community public-nm ROsnmp-server community private-nm RWsnmp-server chassis-id snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart snmp-server enable traps ttysnmp-server enable traps fru-ctrlsnmp-server enable traps entitysnmp-server enable traps flash insertion removalsnmp-server enable traps cpu thresholdsnmp-server enable traps vtpsnmp-server enable traps vlancreatesnmp-server enable traps vlandeletesnmp-server enable traps envmon fan shutdown supply temperature statussnmp-server enable traps port-securitysnmp-server enable traps rfsnmp-server enable traps config-copysnmp-server enable traps configsnmp-server enable traps hsrpsnmp-server enable traps ipmulticastsnmp-server enable traps mac-notification change move thresholdsnmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message snmp-server enable traps bridge newroot topologychangesnmp-server enable traps stpx inconsistency root-inconsistency loop-inconsistency snmp-server enable traps syslogsnmp-server enable traps vlan-membershipsnmp-server host 192.168.201.101 public-nm!control-plane!!line con 0stopbits 1line vty 0 4password ciscologin!endSW4500-2# sh cdp neiCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDSW4500-1 Gig 2/1 167 R S I WS-C4506 Gig 2/1 bangonglou2 Gig 3/48 142 S I WS-C3750G Gig 1/0/24 bangonglou1 Gig 3/47 165 S I WS-C3750G Gig 1/0/24 SW4500-2#SW4500-2#SW4500-2#SW4500-2#SW4500-2#exit[Connection to sw2 closed by foreign host]SW4500-1#fwTrying fw (192.168.201.100)... OpenUser Access VerificationPassword:Type help or '?' for a list of available commands.YMMK-FIREWALL> enPassword: *****YMMK-FIREWALL# wr t: Saved:PIX Version 8.0(4)!hostname YMMK-FIREWALLdomain-name enable password ciscopasswd cisconames!interface Ethernet0nameif outsidesecurity-level 0ip address xx.xx.xx.xx 255.255.255.248!interface Ethernet1nameif insidesecurity-level 100ip address 192.168.201.100 255.255.255.128!ftp mode passivedns server-group DefaultDNSdomain-name access-list intoout extended permit icmp any anyaccess-list intoout extended deny tcp any any eq 135access-list intoout extended deny tcp any any eq netbios-ssnaccess-list intoout extended deny tcp any any eq 445access-list intoout extended deny tcp any any eq 1025access-list intoout extended deny tcp any any eq 4444access-list intoout extended deny tcp any any eq 5554access-list intoout extended deny tcp any any eq 9996access-list intoout extended deny tcp any any eq 69access-list intoout extended deny tcp any any eq 1433access-list intoout extended deny tcp any any eq 1434access-list intoout extended permit ip any anypager lines 24mtu inside 1500mtu outside 1500no failovericmp unreachable rate-limit 1 burst-size 1icmp permit any insideicmp permit any outsideasdm image flash:/asdm-613.binno asdm history enablearp timeout 14400global (outside) 1 interfacenat (inside) 1 192.168.0.0 255.255.0.0static (inside,outside) tcp interface 2741 192.168.201.101 1741 dnsaccess-group intoout in interface insideroute outside 0.0.0.0 0.0.0.0 xx.xx.xx.xx 1route inside 192.168.202.0 255.255.255.0 192.168.201.1 1route inside 192.168.203.0 255.255.255.0 192.168.201.1 1route inside 192.168.204.0 255.255.255.0 192.168.201.1 1route inside 192.168.205.0 255.255.255.0 192.168.201.1 1route inside 192.168.206.0 255.255.255.0 192.168.201.1 1route inside 192.168.207.0 255.255.255.0 192.168.201.1 1route inside 192.168.208.0 255.255.255.0 192.168.201.1 1route inside 192.168.209.0 255.255.255.0 192.168.201.1 1route inside 192.168.210.0 255.255.255.0 192.168.201.1 1timeout xlate 3:00:00timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00 timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolutedynamic-access-policy-record DfltAccessPolicyaaa authentication ssh console LOCALsnmp-server host inside 192.168.201.101 community public-nmno snmp-server locationno snmp-server contactsnmp-server community public-nmsnmp-server enable traps snmp authentication linkup linkdown coldstartsnmp-server enable traps syslogcrypto ipsec security-association lifetime seconds 28800crypto ipsec security-association lifetime kilobytes 4608000telnet 0.0.0.0 0.0.0.0 insidetelnet timeout 5ssh 0.0.0.0 0.0.0.0 outsidessh timeout 20console timeout 0threat-detection basic-threatthreat-detection statistics access-listno threat-detection statistics tcp-interceptusername cisco password 3q8ZgbRKJMLMsGri encrypted!class-map inspection_defaultmatch default-inspection-traffic!!policy-map type inspect dns preset_dns_mapparametersmessage-length maximum 512policy-map global_policyclass inspection_defaultinspect dns preset_dns_mapinspect ftpinspect h323 h225inspect h323 rasinspect netbiosinspect rshinspect rtspinspect esmtpinspect sqlnetinspect sunrpcinspect tftpinspect sipinspect xdmcp!service-policy global_policy globalprompt hostname contextCryptochecksum:3cf0203d19fdb4ac1e58ce9fd4c4af44: end[OK]YMMK-FIREWALL# sh routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 58.18.222.49 to network 0.0.0.0S 192.168.209.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.208.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.210.0 255.255.255.0 [1/0] via 192.168.201.1, insideC 192.168.201.0 255.255.255.128 is directly connected, insideC xx.xx.xx.xx 255.255.255.248 is directly connected, outsideS 192.168.202.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.203.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.204.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.205.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.206.0 255.255.255.0 [1/0] via 192.168.201.1, insideS 192.168.207.0 255.255.255.0 [1/0] via 192.168.201.1, insideS* 0.0.0.0 0.0.0.0 [1/0] via xx.xx.xx.xx, outsideYMMK-FIREWALL# sh xlate172 in use, 389 most usedPAT Global xx.xx.xx.xx(59231) Local 192.168.208.100(15005)PAT Global xx.xx.xx.xx(61203) Local 192.168.202.101(1747)PAT Global xx.xx.xx.xx(6897) Local 192.168.208.104(1491)PAT Global xx.xx.xx.xx(23487) Local 192.168.208.103(2972)PAT Global xx.xx.xx.xx(25050) Local 192.168.208.105(1252)…………YMMK-FIREWALL#$YMMK-FIREWALL# exiLogoff[Connection to fw closed by foreign host] SW4500-1#SW4500-1#SW4500-1#SW4500-1#192.168.201.10Trying 192.168.201.10 ... OpenUser Access VerificationPassword:bangonglou1>enPassword:bangonglou1#wr tBuilding configuration...Current configuration : 3815 bytes!version 12.2no service padservice timestamps debug uptime service timestamps log uptimeno service password-encryption!hostname bangonglou1!enable cisco!no aaa new-modelswitch 1 provision ws-c3750g-24t system mtu routing 1500ip subnet-zero!!!!no file verify autospanning-tree mode pvstspanning-tree extend system-id!vlan internal allocation policy ascending !interface GigabitEthernet1/0/1 switchport access vlan 8spanning-tree portfast!interface GigabitEthernet1/0/2 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/3 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/4 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/5 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/6 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/7 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/8 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/9 switchport access vlan 2spanning-tree portfast!interface GigabitEthernet1/0/10 switchport access vlan 2spanning-tree portfast。
使用Cisco 2610和Cisco 2950配置虚拟局域网(VLAN)之间的路由方法(单臂路由)

使用Cisco 2610和Cisco 2950配置虚拟局域网(VLAN)之间的路由方法网络拓扑如下图:VLAN 192表示192.168.1.0/24网段的电脑,VLAN 172表示172.16.20.0/24网段电脑。
VLAN之间的路由可以有多种方法;A.使用多以太端口路由器,每个VLAN占用一个端口。
B.使用三层交换机。
C.使用单以太端口路由器。
方法C即所谓的单臂路由,它表达得很形象,不象一般的路由,一边进,另一边出,而是哪里进就哪里出。
在C方法下,分述配置步骤:1.在Cisco 2950交换机上配置端口1至8为VLAN 编号172的成员;端口9至16为VLAN编号192的成员;端口24为干道(Trunk),用网线与路由器以太口相连。
Switch#conf tSwitch(config)# int range fastEthernet 0/1 – 8Switch(config-if-range)#switchport mode accessSwitch(config-if-range)#switchport access vlan 172Switch(config-if-range)#exitSwitch(config)# int range fastEthernet 0/9 – 16Switch(config-if-range)#switchport mode accessSwitch(config-if-range)#switchport access vlan 192Switch(config-if-range)#exitSwitch(config)# int fastEthernet 0/24Switch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#exitSwitch#sh run查看一下V ALN端口和Trunk端口:Switch#sh vlan查看一下V ALN:2.在Cisco 2610路由器上配置以太端口的子接口,这时需要用CONSOLE线,因为以太端口没有IP地址,无法telnet上去。
思科Vlan配置实例

思科V l a n配置实例思科Vlan配置实例实验配置:SW-2L1、创建VLAN,并将相应端口加入VLANSW-2L#vlan databaseSW-2L(vlan)#vlan 10SW-2L(vlan)#vlan 20SW-2L(vlan)#vlan 30SW-2L(config)#interface f0/1SW-2L(config-if)#switch access vlan 10SW-2L(config)#interface f0/2SW-2L(config-if)#switch access vlan 20SW-2L(config)#interface f0/3SW-2L(config-if)#switch access vlan 302、创建TRUNKSW-2L(config)#interface f0/24SW-2L(config-if)switch mode trunkSW-3L1、创建VLANSW-3L#vlan databaseSW-3L(vlan)#vlan 10SW-3L(vlan)#vlan 20SW-3L(vlan)#vlan30用show vlan-switch查看2、创建TRUNKSW-3L(config)#interface f0/24SW-3L(config-if)#switch mode trunk3、开启三层交换路由功能SW-3L(conifg)#ip routing4、配置VLAN的IPSW-3L(config)#interface vlan 10SW-3L(config-if)#ip address 192.168.10.254 255.255.255.0 SW-3L(config-if)#no shutdownSW-3L(config)#interface vlan 20SW-3L(config-if)#ip address 192.168.20.254 255.255.255.0 SW-3L(config-if)#no shutdownSW-3L(conifg)#interface vlan30SW-3L(config-if)#ip address 192.168.30.254 255.255.255.0 SW-3L(config-if)#no shutdown5、配置三层交换路由接口SW-3L(config)#interface f0/23SW-3L(config-if)#no switchportSW-3L(config-if)#ip address 10.1.1.1 255.255.255.0SW-3L(config-if)#no shutdown6、配置RIP路由SW-3L(config)#router ripSW-3L(config-router)#no auto-summarySW-3L(config-router)#network 192.168.10.0SW-3L(config-router)#network 192.168.20.0SW-3L(config-router)#network 192.168.30.0SW-3L(conifg-router)#network 10.1.1.0RA1、配置端口IPRA(config)#interface f0/0RA(config-if)#ip address 10.1.1.2 255.255.255.0RA(config-if)#no shutdownRA(config)#interface f0/1RA(config-if)#ip address 172.16.1.1 255.255.255.0RA(config-if)#no shutdown用show run interfere vlan vlan-id查看,或者show interfere vlan vlan-id查看2、配置RIP路由RA(config)#router ripRA(config-router)#no auto-summaryRA(config-router)#network 10.1.1.0RA(config-router)#network 172.16.1.0RB1、配置端口IPRB(config)#interface f0/0RB(config-if)#ip address 172.16.1.2 255.255.255.0RB(config-if)#no shutdown2、配置RIP路由RB(config)#router ripRB(config-router)#no auto-summaryRB(config-router)#network 172.16.1.0端口里面配VLAN,VLAN里面配IP。
思科交换机学习第八课:路由器单臂路由配置实现vlan互通

Switch>enable 2960Switch#configure terminalSwitch(config)#vlan 2Switch(config-vlan)#exit 第一步创建vlan Switch(config)#vlan 3Switch(config-vlan)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#exitSwitch(config)#interface fastEthernet 0/3 端口划分vlanSwitch(config-if)#switchport access vlan 3Switch(config-if)#exitSwitch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunk 交换机跟路由器连接的端口改为trunk Switch(config-if)#exitRouter>enable 开启路由器端口Router#configure terminalRouter(config)#interface fastEthernet 0/0Router(config-if)#no shutdownRouter(config-if)#exitRouter(config)#interface fastEthernet 0/0.1 进入子端口Router(config-subif)#%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to upRouter(config-subif)#encapsulation dot1Q 2Router(config-subif)#ip address 192.168.1.1 255.255.255.0Router(config-subif)#exitRouter(config)#interface fastEthernet 0/0.2 进入子端口Router(config-subif)#%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to upRouter(config-subif)#encapsulation dot1Q 3Router(config-subif)#ip address 192.168.2.1 255.255.255.0Router(config-subif)#endRouter#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.1.0/24 is directly connected, FastEthernet0/0.1C 192.168.2.0/24 is directly connected, FastEthernet0/0.2dot1q就是802.1q,是vlan的一种封装方式。
思科交换机路由器命令大全

思科交换机路由器命令大全思科交换机和路由器命令大全本文档为思科交换机和路由器命令的最新最全范本,供参考使用。
以下是详细的命令列表,包括每个命令的说明和用法。
一、接口配置命令1、ip address:设置接口的IP地质示例:ip address 192.168.1.1 255.255.255:02、no shutdown:启用接口示例:no shutdown3、duplex:设置接口的双工模式示例:duplex auto4、speed:设置接口的速度示例:speed 1005、exit:退出接口配置模式示例:exit二、VLAN命令1、vlan database:进入VLAN数据库模式示例:vlan database2、vlan id name:创建VLAN并设置名称示例:vlan 10 name VLAN-103、vlan id:删除VLAN示例:no vlan 104、show vlan:显示VLAN信息示例:show vlan5、exit:退出VLAN数据库模式示例:exit三、路由命令1、ip route:设置静态路由示例:ip route 192.168.2:0 255.255.255:0 192.168.1.22、router rip:启用RIP路由协议示例:router rip3、network:将网络添加到RIP路由表中示例:network 10:0:0:04、redistribute:将静态路由或其他路由协议添加到RIP路由表中示例:redistribute static5、exit:退出路由配置模式示例:exit四、ACL命令1、access-list:创建标准或扩展ACL示例:access-list 10 permit 192.168.1:0 0:0:0.2552、ip access-group:应用ACL到接口示例:ip access-group 10 in3、show access-lists:显示ACL信息示例:show access-lists4、exit:退出ACL配置模式示例:exit五、SNMP命令1、snmp-server community:设置SNMP团体字符串示例:snmp-server community public RO2、snmp-server enable traps:启用SNMP陷阱示例:snmp-server enable traps3、snmp-server host:配置SNMP陷阱接收主机示例:snmp-server host 192.168.1.1004、exit:退出SNMP配置模式示例:exit六、SSH命令1、ip ssh version:设置SSH协议版本示例:ip ssh version 22、crypto key generate rsa:RSA密钥对示例:crypto key generate rsa3、username:创建新的本地用户示例:username admin privilege 15 password password1234、exit:退出SSH配置模式示例:exit七、其他命令1、show running-config:显示当前配置示例:show running-config2、copy running-config startup-config:将当前配置保存到启动配置中示例:copy running-config startup-config3、reload:重新启动设备示例:reload4、exit:退出CLI命令行模式示例:exit本文档涉及附件:1、无附件本文所涉及的法律名词及注释:1、ACL(Access Control List):访问控制列表,用于控制网络流量的进出。
思科路由器VLAN的配置

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
PC1#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
Switch(vlan)#exit
APPLY completed.
Exiting....
步骤五:查看VLAN是否创建成功
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------------------------
---- -------------------------------- --------- -----------------------------
1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14
.....
Success rate is 0 percent (0/5), round-trip min/avg/max = 1/2/4 ms
.....
Success rate is 0 percent (0/5), round-trip min/avg/max = 1/2/4 ms
PC1#ping 192.168.1.4
Type escape sequence to abort.
思科Vlan配置过程

Vlan配置过程Switch>Switch>enSwitch#Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#Switch(config)#vlan 5 新建vlan 5Switch(config-vlan)#vlan 10 新建vlan10Switch(config-vlan)#vlan 15 新建vlan 15Switch(config-vlan)#vlan 20 新建vlan 20Switch(config-vlan)#exitSwitch(config)#Switch(config)#interface range fastethernet 0/1-5 进入fa/1-5端口Switch(config-if-range)#Switch(config-if-range)#switchport access vlan 5 划分fa/1-5端口到vlan5 Switch(config-if-range)#exitSwitch(config)#Switch(config)#interface range fastethernet 0/6-10Switch(config-if-range)#switchport access vlan 10Switch(config-if-range)#exitSwitch(config)#interface range fastethernet 0/11-15Switch(config-if-range)#switchport access vlan 15Switch(config-if-range)#exitSwitch(config)#Switch(config)#interface range fastethernet 0/16-20Switch(config-if-range)#switchport access vlan 20Switch(config-if-range)#exitSwitch(config)#Switch(config)#endSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#Switch#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/21, Fa0/22, Fa0/23, Fa0/24Gig1/1, Gig1/25 VLAN0005 active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/510 VLAN0010 active Fa0/6, Fa0/7, Fa0/8, Fa0/9Fa0/1015 VLAN0015 active Fa0/11, Fa0/12, Fa0/13, Fa0/14Fa0/1520 VLAN0020 active Fa0/16, Fa0/17, Fa0/18, Fa0/19Fa0/201002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 05 enet 100005 1500 - - - - - 0 010 enet 100010 1500 - - - - - 0 015 enet 100015 1500 - - - - - 0 020 enet 100020 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 01003 tr 101003 1500 - - - - - 0 01004 fdnet 101004 1500 - - - ieee - 0 01005 trnet 101005 1500 - - - ibm - 0 0Remote SPAN VLANs------------------------------------------------------------------------------Primary Secondary Type Ports------- --------- ----------------- ------------------------------------------Switch#Switch(config)#end%SYS-5-CONFIG_I: Configured from console by consoleSwitch#Switch#write memory 保存命令Building configuration...[OK]Switch#。
思科VLAN的配置命令

VLAN的基本配置命令1、创建vlan方法一switch#vlan databaseswitch(vlan)#vlan 10 name wzswitch(vlan)#exit2、创建vlan方法二switch(config)#vlan 10switch(config-vlan)#name wz3、删除vlan方法一switch(vlan)#no vlan 10switch(vlan)#exit4、删除vlan方法二switch(config)#no interface vlan 10switch(config)#no vlan 105、删除vlan方法三switch#delete vlan.dat6、将端口加入到vlan中switch(config-if)#switchport access vlan 107、将一组连续的端口加入到vlan中switch(config)# interface range f0/1 – 5switch(config)#interface range f0/6-8,0/9-11,0/22(将不连续多个端口加入到Vlan中)switch(config-if-range)#switchport access vlan 108、将端口从vlan中删除switch(config-if)#no switchport access vlan 10switch(config-if)#switchport access vlan 1switch(config-if-range)#no switchport access vlan 10switch(config-if-range)#switchport access vlan 19、查看所有vlan的摘要信息switch#show vlan brief10、查看指定vlan的信息switch#show vlan id 1011、指定端口成为trunkswitch(config-if)#switchport mode trunk12、Trunk的自动协商switch(config-if)#switchport mode dynamic desirableswitch(config-if)#switchport mode dynamic auto注意:如果中继链路两端都设置成auto将不能成为trunk13、查看端口状态switch#show interface f0/2 switchport14、在trunk上移出vlanswitch(config-if)#switchport trunk allowed vlan remove 2015、在trunk上添加vlanswitch(config-if)#switchport trunk allowed vlan add 20公司内部进行VLAN的划分实例对于每个公司而言都有自己不同的需求,下面我们给出一个典型的公司的VLAN的实例,这样也可以成为我们以后为公司划分VLAN的依据。
思科VLAN的基本配置命令

思科交换机的基本配置命令学习CISCO交换机基本配置:Console端口连接交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname csico ;设置交换机的主机名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#exit ;返回命令switch(config)#int f0/1 ;进入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 设置该端口速率为100mb/s (10/auto) switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 设置该端口为全双工(auto/half)switch(config)#description TO_PC1 这是该端口描述为TO_PC1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为trunk模式(access 模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain vtpserver ;设置vtp域名相同switch(config)#vtp password ;设置发vtp密码switch(config)#vtp server ;设置vtp服务器模式switch(config)#vtp client ;设置vtp客户机模式交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP 地址switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关switch(config)#ip domain-name 设置域名switch(config)#ip name-server 192.168.1.18 设置域名服务器switch(config)#mac-address-table? 查看mac-address-table的子命令switch(config)#mac-address-table aging-time 100 设置超时时间为100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7switch(config)#endswitch#show mac-address-table 查看整个MAC地址表switch#clear mac-address-table restricted static 清除限制性静态地址交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口状态switch#dir flash: ;查看闪存(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface 接口类型接口号"全局配置模式----线控模式,使用命令"line 接口类型接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add ip地址配置IP地址secondary IP地址为接口配置第二个IP地址show interface 接口类型接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆【VLAN的基本配置命令】创建配置vlan1、从特权模式进入vlan模式,交换机添加VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:Switch>Switch>enSwitch#vlan database ;进入VLAN设置% Warning: It is recommended to configure VLAN from config mode,as VLAN database mode is being deprecated. Please consult userdocumentation for configuring VTP/VLAN in config mode.switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3 switch(vlan)#no vlan 2 ;删vlan 2如下实例:Switch(vlan)#vlan 2 name yv1VLAN 2 added:Name: yv1Switch(vlan)#vlan 3 name yv2VLAN 3 added:Name: yv2Switch(vlan)#vlan 4 name yv3VLAN 4 added:Name: yv3Switch(vlan)#exit 保存退出APPLY completed.Exiting....划端口进VLAN首先进入用户模式“<Sw>"在用户模式下输入”en“,进入特权模式”Sw#<switch>enswitch#在特权模式下输入”configure terminal“,进入全局模式”Sw(config)#switch#configure terminalswitch#(config)#接下来在全局模式下进入接口模式,输入”int range f0/1-3“,这里注意了使用range参数才可以进入多接口,这里选择f0/1、f0/2、f0/3,三个接口。
思科小型局域网配置

引言:局域网(LocalAreaNetwork,LAN)是一种将多台计算机和网络设备连接在一起的网络。
思科是全球知名的网络设备供应商,其产品和解决方案被广泛应用于各个规模和类型的局域网中。
本文将给您介绍思科小型局域网的配置方法。
概述:1.硬件设备选择路由器选择:根据局域网规模和需求选择合适的思科路由器型号。
交换机选择:根据局域网设备的数量和对网络速度的要求选择合适的思科交换机型号。
网络线缆选择:根据局域网的物理布局和设备之间的距离选择合适的网线类型。
2.基本网络设置IP地质分配:设置局域网各个设备的IP地质,以便它们能够相互通信。
子网掩码设置:配置子网掩码以确定IP地质的网络部分和主机部分。
默认网关设置:设置默认网关,以便局域网内的设备可以与外部网络通信。
3.VLAN配置VLAN概述:介绍什么是虚拟局域网(VirtualLocalAreaNetwork,VLAN)以及其在思科小型局域网中的应用。
VLAN创建:创建和配置VLAN,在局域网内划分不同的广播域。
VLAN间路由:配置VLAN间的路由,实现跨VLAN的通信。
4.安全配置访问控制列表:创建和配置访问控制列表,限制对网络资源的访问。
端口安全策略:配置端口安全以保护局域网免受未授权的设备访问。
802.1X认证:设置IEEE802.1X认证,确保只有经过授权的设备可以接入局域网。
5.监控和故障排查设备监控:使用思科网络设备的监控功能,实时监测局域网的性能和健康状态。
日志记录和分析:配置设备的日志记录,帮助排查和解决局域网故障。
远程管理:使用远程管理工具对思科网络设备进行管理和故障排查。
总结:思科小型局域网配置是一个综合性的过程,需要考虑硬件设备选择、基本网络设置、VLAN配置、安全配置以及监控和故障排查等方面。
通过正确地配置思科设备,可以确保小型局域网的正常运行和安全性。
在进行配置时,应根据实际情况进行灵活调整,并定期进行网络性能和安全性的评估和更新。
思科实验模拟单臂路由器实现VLAN

1.建立实验拓扑图并完成网络配置:
2.进入命令行接口配置模式,完成路由器逻辑接口的配置:
3.测试主机之间的连通性(PC0-->PC1):
4.两次测试及分析(PC0-->PC1):
第一次失败原因:
第一次发送主要是用ARP在内网(VLAN2)中广播报文,寻找目标终端及获取默认网关接口MAC地址,但没有找到目标终端(PC1),然后失败。
第二次成功原因:
第二次已经知道默认网关接口的MAC地址,所以发送的报文到路由器时,路由器直接根据路由表向外网转发报文,即向VLAN3中的PC1转发报文。
期间主要发生的过程主要是ICMP的请求与应答过程,请求成功,成功应答。
cisco设置vlan

cisco设置vlancisco设置vlan?怎么设置?最近有网友这样问小编。
店铺去网上搜索了相关资料,给大家奉上,希望大家喜欢。
思科路由器配置vlan拓扑如下:分类:1.注意事项1.1.交换机启动需要大约4-5分钟;1.2.网线插入交换机接口从黄变为绿需要大约1-2分钟,即进入正常工作模式;1.3.建议使用XP系统进行操作,2003默认没有安装超级终端,需要使用安装光盘添加该工具才有;1.4.请严格按照以下步骤进行,背景灰色字体为交换机显示信息,蓝色字体为配置命令。
2.准备工作先保持交换机断电状态;使用调试串口线连接笔记本电脑的串口与交换机背面的CONSOLE接口;打开超级终端:开始-所有程序-附件-超级终端;配置超级终端:名称-cisco选择com1或com2(请依照实际情况进行选择)修改每秒位数为9600应用-确定-回车;3.初始配置给交换机通电;片刻后会看到交换机的启动信息,直到出现以下配置选项:Would you like to terminate autoinstall? [yes]: noWould you like to enter the initial configuration dialog? [yes/no]:noWould you like to terminate autoinstall? [yes]: no4.出现命令窗口Switch>5.备份出厂配置Switch>en 进入特权模式Switch#copy running-config sfbak-configDestination filename [sfbak-config]?回车片刻后会出现:1204 bytes copied in 0.529 secs (2276 bytes/sec)表示文件备份成功。
6.配置账号密码Switch#configure terminal 进入配置子模式Switch(config)#enable password cisco 设置PASSWORD密码为ciscoSwitch(config)#enable secret cisco 设置SECRET密码为cisco Switch(config)#exit片刻后会出现:00:11:26: %SYS-5-CONFIG_I: Configured from console by console表示将配置保存到了内存中,在后面的配置过程中会出现类似的信息,属于正常现象。
思科路由器配置教程

思科路由器配置教程1. 硬件准备1. 路由器型号选择2. 连接线材准备2. 基本网络设置1. 登录路由器管理界面- 输入默认IP地址和用户名密码进行登录2. 修改管理员账户信息及密码安全策略3. IP 地址分配与子网划分- 配置静态 IP 地址或启用 DHCP 动态获取4 . VLAN 设置- 创建虚拟局域网(VLAN)并为其指定端口5 . NAT 和 PAT 的配置- 启用 Network Address Translation (NAT) 6 . ACL(访问控制列表)的使用- 创建ACL规则,限制特定流量通过7 . VPN (Virtual Private Network)的建立a) Site-to-Site VPNi ) IPSec 加密协议ii ) GRE 协议iii ) IKE 密钥交换iv ) 认证方式8 . QoS(服务质量)设定a) 流分类i ) 标记化ii ) 分类方法iii ). DSCP码点IV). CoS值v). IPP Precedence vi.) ToS字段Vii.). MPLS EXP位VIII.).802.lp优先级 IX ).VLAN标签X ).源/目标MAC地址XI). 源/目标IP地址XII). 源/目标端口号XIII ).协议类型XIV) .应用程序b ) 流量控制i ) 速率限制ii ).拥塞避免iii.).队列管理iv.) 延迟敏感性v).带宽保证vi.)优先级调度Vii.)流量整形VIII.).排队方式9 . 路由配置- 配置静态路由或动态路由协议10 . 系统日志和监控a) 日志记录i ) 设置系统日志等级ii ). 远程登录服务器iii.) SNMP 监视器设置11. 安全策略与防火墙- 启用基本的安全功能,如访问列表、ACL 和 Zone-Based Firewall12. 文档维护及更新附件:1. 示例配置文件2. 图表和网络拓扑图示例法律名词及注释:1.NAT:Network Address Translation(网络地址转换),一种将私有 IP 地址映射为公共 IP 地址的技术。
思科Cisco路由器配置——单臂路由实现VLAN间通信实验详解

思科Cisco路由器配置——单臂路由实现VLAN间通信实验详解本⽂实例讲述了思科Cisco单臂路由实现VLAN间通信实验。
分享给⼤家供⼤家参考,具体如下:⼀、实验⽬的:⽤路由器使同和不同vlan可以通信⼆、拓扑图如下:三、具体步骤:(1)R1路由器配置:Router>en --进⼊特权模式Router#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1 --修改路由器名为R1R1(config)#interface f0/0 --进⼊端⼝R1(config-if)#no shutdown --开启端⼝R1(config-if)#interface f0/0.1 --进⼊⼦端⼝R1(config-subif)#encapsulation dot1q 10R1(config-subif)#ip address 192.168.1.254 255.255.255.0 --给⼦端⼝设置ip地址R1(config-subif)#interface f0/0.2 --进⼊⼦端⼝R1(config-subif)#encapsulation dot1q 20 --封装端⼝R1(config-subif)#ip address 192.168.2.254 255.255.255.0 --给⼦端⼝设置ip地址R1(config-subif)#interface f0/0.3 --进⼊⼦端⼝R1(config-subif)#encapsulation dot1q 30 --封装端⼝R1(config-subif)#ip address 192.168.3.254 255.255.255.0 --给⼦端⼝设置ip地址R1(config-subif)#interface f0/0.4 --进⼊⼦端⼝R1(config-subif)#encapsulation dot1q 40 --封装端⼝R1(config-subif)#ip address 192.168.4.254 255.255.255.0 --给⼦端⼝设置ip地址R1(config-subif)#end --返回特权模式R1#copy running-config startup-config --保存配置[OK] --保存成功(2)S1交换机配置Switch>en --进⼊全局配置模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S1 --修改交换机名为S1S1(config)#vtp domain abc --创建vtp域Domain name already set to abc.S1(config)#vtp mode server 设置当前交换机在vtp中为server模式Device mode already VTP SERVER.S1(config)#vlan 10 --创建vlan 10S1(config-vlan)#vlan 20 --创建vlan 20S1(config-vlan)#vlan 30 --创建vlan 30S1(config-vlan)#vlan 40 --创建vlan 40S1(config-vlan)#interface range f0/1-4 --进⼊f0/1,f0/2,f0/3,f0/4端⼝S1(config-if-range)#switchport mode trunk --设置f0/1-f0/4之间所有端⼝为trunk模式S1(config-if-range)#interface range f0/10-11 --进⼊f0/10和f0/11端⼝S1(config-if-range)#switchport mode access --设置f0/10,f0/11端⼝为access模式S1(config-if-range)#switchport access vlan 40 --将f0/10,f0/11端⼝划⼊vlan 40S1(config-if-range)#end --返回特权模式S1#copy running-config startup-config --保存配置[OK] --保存成功(3)S2交换机配置Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S2 --修改交换机名为S2S2(config)#vtp mode client --设置当前交换机在vtp中为客户模式Device mode already VTP CLIENT.S2(config)#interface f0/1 --进⼊f0/1端⼝S2(config-if)#switchport mode access --设置f0/1端⼝为access模式S2(config-if)#switchport access vlan 10 --将f0/1端⼝划⼊vlan 10 S2(config-if)#interface f0/2 --进⼊f0/2端⼝S2(config-if)#switchport mode access --设置f0/2端⼝为access模式S2(config-if)#switchport access vlan 20 --将f0/2划⼊vlan2S2(config-if)#interface f0/3 --进⼊f0/3端⼝S2(config-if)#switchport mode access --设置f0/3端⼝为access模式S2(config-if)#switchport access vlan 30 --将f0/3端⼝划⼊vlan 30 S2(config-if)#interface f0/4 --进⼊f0/4端⼝S2(config-if)#switchport mode trunk --设置f0/4端⼝为trunk模式S2(config-if)#end --返回特权模式S2#copy running-config startup-config --保存配置[OK] --保存成功(4)S3交换机配置Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S3 --修改交换机名为S3S3(config)#vtp mode client --设置当前交换机在vtp中为客户模式Device mode already VTP CLIENT.S3(config)#interface f0/1 --进⼊f0/1端⼝S3(config-if)#switchport mode access --设置f0/1端⼝为access模式S3(config-if)#switchport access vlan 10 --将f0/1端⼝划⼊vlan 10 S3(config-if)#interface f0/2 --进⼊f0/2端⼝S3(config-if)#switchport mode access --设置f0/2端⼝为access模式S3(config-if)#switchport access vlan 20 --将f0/2端⼝划⼊vlan 20 S3(config-if)#interface f0/3 --进⼊f0/3端⼝S3(config-if)#switchport mode access --设置f0/3端⼝为access模式S3(config-if)#switchport access vlan 30 --将f0/3端⼝划⼊vlan 30 S3(config-if)#interface f0/4 --进⼊f0/4端⼝S3(config-if)#switchport mode trunk --设置f0/4端⼝为trunk模式S3(config-if)#end --返回特权模式S3#copy running-config startup-config --保存配置[OK] --保存成功(5)S4交换机配置Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S4 --修改交换机名为S4S4(config)#vtp mode client --设置当前交换机在VTP中为客户模式Device mode already VTP CLIENT.S4(config)#interface f0/1 --进⼊f0/1端⼝S4(config-if)#switchport mode access --设置f0/1端⼝为access模式S4(config-if)#switchport access vlan 10 --将f0/1划分到vlan 10S4(config-if)#interface f0/2 --进⼊f0/2端⼝S4(config-if)#switchport mode access --设置f0/2端⼝为access模式S4(config-if)#switchport access vlan 20 --将f0/2划分到vlan 20S4(config-if)#interface f0/3 --进⼊f0/3端⼝S4(config-if)#switchport mode access --设置f0/3端⼝为access模式S4(config-if)#switchport access vlan 30 --将f0/3划分到vlan 30S4(config-if)#interface f0/4 --进⼊f0/4端⼝S4(config-if)#switchport mode trunk --将f0/4端⼝设置为trunk模式S4(config-if)#end --返回特权模式S4#copy running-config startup-config --保存配置[OK] --保存成功四、验证不同vlan是否能通讯(1)PC11与PC22vlan 10和vlan 20可以通信(2)PC33与WEBvlan 30 与vlan 40 可以通信。
思科路由器配置vlan

Packet Tracer 5.0建构CCNA实验攻略(2)——配置VLAN
Vlan(Virtual Local Area Network)即虚拟局域网。
VLAN可以把同一个物理网络划分为多个逻辑网段,因此,Vlan可以抑制网络风暴,增强网络的安全性。
一、实例拓扑图
图一交换机Cisco 2960
二、创建VLAN
在Cisco IOS中有两种方式创建vlan,在全局配置模式下使用vlan vlanid命令,如
switch(config)#vlan 10;在vlan database下创建vlan,如switch(vlan)vlan 20
图二创建vlan
三、把端口划分给vlan(基于端口的vlan)
switch(config)#interface fastethernet0/1 进入端口配置模式
switch(config-if)#switchport mode access 配置端口为access模式switch(config-if)#switchport access vlan 10 把端口划分到vlan 10
图三
如果一次把多个端口划分给某个vlan可以使用interface range命令。
图四
四、查看vlan信息
switch#show vlan
图五
图六show vlan brief 查看vlan简明信息图七查看id为10的vlan
图八通过vlan的名字查看vlan
五、删除配置
图九把第0个模块中的第8个端口从vlan 40中删除
图十删除vlan 40
我们还可以为每个vlan配置ip地址。
思科VTP配置和VLAN间路由

5、按照图示配置路由器的F0/0、F0/1的IP地址,并启用这两个端口
6、想一想交换机与路由器相连的两个端口应该怎么设置?为什么?
7、要让PCA和PCB通信,必须分别把PCA,PCB的网关设为什么?
网络拓扑图如下:
1、按上图连好线。(假设PCA接入交换机的F0/5,PCB接入交换机的F0/10,路由器的F0/0接入交换机的F0/1,设备原有的配置。
3、设置PCA的IP为192.168.1.5/24;设置PCB的IP为192.168.2.5/24
2、清空交机上的配置。
3、相看交换机的初始VTP状态:
域名为空,模式为服务器。
4、设置SWA为VTP SERVER模式,域名为ABC,密码为123。
5、在SWA上配置VLAN 10,20
6、设置SWB的VTP模式为CLIENT,域名为ABC,密码为123。
7、查看SWB上的VLAN
可以看到在SWA上生成的VLAN 10,20已经传播到SWB上。
封装dot1q vlan 10
[Router-Ethernet0.1]vlan-type dot1q vid 10
其余命令类同思科。
在交换机上生成VLAN 10,VLAN 20,把F0/5划入VLAN 10,把F0/10划入VLAN 20。
下面重点讲解路由器子接口的配置
4、在路由器上的物理接口F0/0上生成子接口F0/0.1
Router(config)#interface f0/0.1
在f0/0/.1上封装VLAN 10
Router(config-subif)#encapsulation dot1q 10
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Packet Tracer 5.0建构CCNA实验攻略(2)——配置VLAN
Vlan(Virtual Local Area Network)即虚拟局域网。
VLAN可以把同一个物理网络划分为多个逻辑网段,因此,Vlan可以抑制网络风暴,增强网络的安全性。
一、实例拓扑图
图一交换机Cisco 2960
二、创建VLAN
在Cisco IOS中有两种方式创建vlan,在全局配置模式下使用vlan vlanid命令,如
switch(config)#vlan 10;在vlan database下创建vlan,如switch(vlan)vlan 20
图二创建vlan
三、把端口划分给vlan(基于端口的vlan)
switch(config)#interface fastethernet0/1 进入端口配置模式
switch(config-if)#switchport mode access 配置端口为access模式switch(config-if)#switchport access vlan 10 把端口划分到vlan 10
图三
如果一次把多个端口划分给某个vlan可以使用interface range命令。
图四
四、查看vlan信息
switch#show vlan
图五
图六show vlan brief 查看vlan简明信息图七查看id为10的vlan
图八通过vlan的名字查看vlan
五、删除配置
图九把第0个模块中的第8个端口从vlan 40中删除
图十删除vlan 40
我们还可以为每个vlan配置ip地址。