您的位置:首页 > 其它

Windows绑定网关的方法

2013-10-27 16:15 330 查看




现在开始配置!

第一步:得到PC1主机的mac地址





第二步:配置交换机的IP地址

Switch>en

Switch>enable

Switch#conf

Switch#configure

Configuring from terminal, memory, or network [terminal]?

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

Switch(config)#in vl

Switch(config)#in vlan 1

Switch(config-if)#ip add 192.168.1.4 255.255.255.0

Switch(config-if)#no shu

Switch(config-if)#no shutdown

[align=left]%LINK-5-CHANGED: Interface Vlan1, changed state to up[/align]
[align=left]%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up[/align]
[align=left]Switch(config-if)#ex[/align]
[align=left]第三步:使能端口的MAC地址绑定功能,添加端口静态安全MAC地址,缺省端口最大安全MAC地址数为1[/align]
Switch(config)#in f0/1

Switch(config-if)#sw

Switch(config-if)#switchport m

Switch(config-if)#switchport mode a

Switch(config-if)#switchport mode access

Switch(config-if)#sw

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security 《===========这步也是一条命令,不要忘记加

Switch(config-if)#sw

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security mac

Switch(config-if)#switchport port-security mac-address 0030.F2B6.B546

Switch(config-if)#ex

[align=left]配置完成后结果图是[/align]


这是F0/1连接刚绑定过MAC地址的主机0

如果不是连接主机0 结果图会是这样





现在来配置在一个以太口上静态捆绑多个MAC





第一步:获取所需绑定的主机MAC地址







第二步:在交换机上配置相关命令(当然我们刚开始已经绑定单个MAC地址了)

Switch(config)#in f0/1

Switch(config-if)#sw

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security max

Switch(config-if)#switchport port-security maximum 3

Switch(config-if)#sw

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security mac

Switch(config-if)#switchport port-security mac-address 000C.85BB.4610

Switch(config-if)#sw

Switch(config-if)#switchport p

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security mac

Switch(config-if)#switchport port-security mac-address 000C.CF24.140B

Switch(config-if)#ex

Switch(config)#

%LINK-5-CHANGED: Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

结果图以单个MAC地址结果图一样.

那么有没有一种办法让它将接入到此端口的MAC地址自动绑定到这个MAC地址中呢?

下面是配置过程:

Switch>enable

Switch#conf

Switch#configure

Configuring from terminal, memory, or network [terminal]?

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


Switch(config)#in f0/2

Switch(config-if)#sw

Switch(config-if)#switchport m

Switch(config-if)#switchport mode a

Switch(config-if)#switchport mode access

Switch(config-if)#sw

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security

Switch(config-if)#sw

Switch(config-if)#switchport po

Switch(config-if)#switchport port-security max

Switch(config-if)#switchport port-security maximum 3

Switch(config-if)#switchport port-security mac-address sticky

Switch(config-if)#ex

Switch(config)#

我这里是配置的是将前三个接入到这个端口的计算机的MAC地址自动的加入到MAC地址表
本文出自 “企业网搭建-路由交换” 博客,请务必保留此出处http://yangfusheng.blog.51cto.com/6267818/1086738
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: