频道栏目
首页 > 网络 > 其他 > 正文

Cisco单臂路由 - DY - 51CTO技术博客

2019-04-12 15:12:56         来源:郭陈勇 的BLOG   
收藏   我要投稿

一台路由器

一台交换机

两台PC机

e13e645c97f691f4fd654f25a4c45037.png

路由器配置:

R1#conf t

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

R1(config)#int e0/0

R1(config-if)#no sh

R1(config-if)#int e0/0.1

R1(config-subif)#encapsulation dot1Q 2 //子接口封装VLAN

R1(config-subif)#ip address 192.168.10.1 255.255.255.0

R1(config-subif)#no sh

R1(config-subif)#int e0/0.

R1(config-subif)#int e0/0.2

R1(config-subif)#encapsulation dot1Q 3 //子接口封装VLAN

R1(config-subif)#ip address 192.168.20.1 255.255.255.0

R1(config-subif)#no sh

R1(config-subif)#do sh ip int br

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 unassigned YES unset up up

Ethernet0/0.1 192.168.10.1 YES manual up up

Ethernet0/0.2 192.168.20.1 YES manual up up

Ethernet0/1 unassigned YES unset administratively down down

Ethernet0/2 unassigned YES unset administratively down down

Ethernet0/3 unassigned YES unset administratively down down

交换机配置:

SW1#

SW1#vlan database

SW1(vlan)#vlan 2 //创建VLAN2

VLAN 2 added:

Name: VLAN0002

SW1(vlan)#vlan 3 //创建VLAN3

VLAN 3 added:

Name: VLAN0003

ot half duplex), with R1 Ethernet0/0 (half duplex).

SW1(vlan)#exit

APPLY completed.

Exiting....

SW1#conf t

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

SW1(config)#int f1/0

SW1(config-if)#switchport mode trunk //设置F1/0为中继

SW1(config-if)#no sh

SW1(config-if)#int f1/1

SW1(config-if)#switchport access vlan 2 //接口加入VLAN2

SW1(config-if)#int f1/2

SW1(config-if)#switchport access vlan 3 //接口加入VLAN3

SW1(config-if)#do sh vlan-s br


VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa1/3, Fa1/4, Fa1/5,

Fa1/6,Fa1/7, Fa1/8,

Fa1/9, Fa1/10,Fa1/11,

Fa1/12, Fa1/13, Fa1/14

Fa1/15

2 VLAN0002 active Fa1/1

3 VLAN0003 active Fa1/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

SW1(config-if)#do sh ip int br

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES unset administratively down down

FastEthernet0/1 unassigned YES unset administratively down down

FastEthernet1/0 unassigned YES unset up up

FastEthernet1/1 unassigned YES unset up up

FastEthernet1/2 unassigned YES unset up up

FastEthernet1/3 unassigned YES unset up down

FastEthernet1/4 unassigned YES unset up down

FastEthernet1/5 unassigned YES unset up down

FastEthernet1/6 unassigned YES unset up down

FastEthernet1/7 unassigned YES unset up down

FastEthernet1/8 unassigned YES unset up down

FastEthernet1/9 unassigned YES unset up down

FastEthernet1/10 unassigned YES unset up down

FastEthernet1/11 unassigned YES unset up down

FastEthernet1/12 unassigned YES unset up down

FastEthernet1/13 unassigned YES unset up down

FastEthernet1/14 unassigned YES unset up down

FastEthernet1/15 unassigned YES unset up down

Vlan1 unassigned YES unset up up


查看两台PC机的状况

cf09f341027c24b63b72d056cbf9fed5.png

fa0d1340f99c7f4581b3e6cc913e4226.png



本文出自 “DY” 博客,请务必保留此出处http://guochenyong.blog.51cto.com/11367898/1975458

上一篇:【安全牛学习笔记】Kali Linux Comstomization - 11662938 - 51CTO技术博客
下一篇:【安全牛学习笔记】Penetration testing presentation - 11662938 - 51CTO技术博客
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站