有同学问到了二层网管,先说三层的吧,三层的有IP地址,随便找个IP地址就能进去,但是规划良好的网络都是有单独的网管IP的。单独的VLAN用来做网管。
这也就是二层网管的方法。设置一个单独的VLAN,作为VLAN,默认是VLAN1,可以随便改的。如图所示是一个简单的企业小网。
VLAN 10 IP地址段192.168.10.0/24
VLAN 20 IP地址段192.168.20.0/24
VLAN 30 IP地址段192.168.30.0/24【VLAN】
在二层交换机上设置VLAN 30接口IP地址,并设置网关即可。
测试结果
PC>ping 192.168.30.3??
Pinging 192.168.30.3 with 32 bytes of data:
Request timed out.
Request timed out.
Reply from 192.168.30.3: bytes=32 time=94ms TTL=254
Reply from 192.168.30.3: bytes=32 time=94ms TTL=254
Ping statistics for 192.168.30.3:
??? Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),
Approximate round trip times in milli-seconds:
??? Minimum = 94ms, Maximum = 94ms, Average = 94ms
PC>telent 192.168.30.2
Invalid Command.
PC>telnet 192.168.30.2
Trying 192.168.30.2 …Open
User Access Verification
Password:
测试成功!
关键代码:
interface Vlan30
?ip address 192.168.30.2 255.255.255.0
!
ip default-gateway 192.168.30.1
如果二层交换机不设置网关,那就先telnet 192.168.30.1 在telnet 192.168.30.2
- « 上一篇:
- :下一篇 »
发表于 May 4, 2010 6:00 pm
二层交换机默认只能起一个VLAN,起了别的VLAN 1会down掉