您的位置:首页 > 其它

vlan的基本配置1

2012-12-05 16:27 302 查看

VLAN的基本命令

1.交换机上配置IP

1. 命名Switch(config)# host S2950
2. 配置IP
S2950(config)# int vlan 1 管理VLAN
S2950(config-if)# ip add 192.168.1.210 255.255.255.0

3. [/b]S2950(config)# ip default-gateway 192.168.1.251[/b]

目的:方便从其它网段对SW进行Telnet远程管理。

4.[/b]查看[/b]MAC[/b]表。[/b]

S2950#sh mac-add
5.设置双工和速率。
S2950(config)# int f0/1
S2950(config-if)#speed 10 / 100 / auto
S2950(config-if)#duplex half / full / auto

2.Vlan的配置

1. [/b]划分[/b]VLAN[/b]。[/b]

S2950config# vlan 2
S2950config# vlan 2-4
S2950config# vlan 2-4,10,20,30

2. 将端口划到[/b]VLAN[/b]。[/b]

S2924config# int f0/3
# switchport mode access
# sw acc vlan 2
S2950config# int range f0/3 – 4
S2950(config-range-if)# sw mode acc

S2950(config-range-if)# sw acc vlan 2

3. 将接口配置成trunk.

S3560[/b]([/b]config[/b])[/b]# int f0/ 24[/b]

S35600(config-range-if)# sw trunk encapsulation isl

dotlq 2950 默认)

S35600(config-range-if)# sw mode trunk

S35600(config-range-if)# sw nonegotiate

4. VTP

S3560[/b]([/b]config[/b])[/b]# vtp domain wq.com [/b]域名必须设置

# vtp mode server(服务器)/ client(客户端)/ transparent(透明模式)

#vtp pass cisco 密码为可选

5. 单臂路由(在交换机的接口配置成trunk模式,路由器上配置命令如下:)

R1([/b]config[/b])[/b]#int f0/1[/b]

R1([/b]config-if[/b])[/b]#no shutdown[/b]

R1([/b]config-if[/b])#inf f0/1.2(vlan2)[/b]

R1(config-subif)#encapsulation dot1Q 2

R1(config-subif)#ip add 192.168.2.254 255.255.255.0

R1([/b]config-if[/b])#inf f0/1.3(vlan3)[/b]

R1(config-subif)#encapsulation dot1Q 3

R1(config-subif)#ip add 192.168.3.254 255.255.255.0

R1(config-subif)#exit

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: