实现方法:
+++++++++++++++++++++++++++++++++++++++++++++++
Sw0
+++++++++++++++++++++++++++++++++++++++++++++++
en
conf t
no ip do lo
line c 0
exec-t 0 0
logg sync
exit
line vty 0 4
password pass123
login
exit
enable password pass123
in vlan 1
ip add 172.16.1.1 255.255.0.0
no sh
end
write
++++++++++++++++++++++++++++++++++++++++++++++++
解释:vlan1设IP不过是大多是这样设罢啦!
也可以给vlan 10 ,100,设这个管理IP。但要注意:
主机必须在设置IP的vlan里。
如果使用单臂路由技术,并且交换机和主机不在一个网段里那么必须给交换机设置网关。ip default-gateway IP
例如:
配置:
+++++++++++++++++++++++++++++++++++
sw0
+++++++++++++++++++++++++++++++++++
en
vlan d
vlan 10
exit
conf t
in f0/1
sw m t
exit
line vty 0 4
pass 123
login
exit
enable pass 123
in vlan 10
ip add 172.16.0.1 255.255.0.0
no sh
exit
ip default-gateway 172.16.0.254
end
++++++++++++++++++++++++++++++++++++
r1
+++++++++++++++++++++++++++++++++++
en
conf t
in f0/0
no sh
exit
in f0/0.1
encapsulation dot1q 10
ip add 172.16.0.254 255.255.0.0
exit
in f0/1
ip add 192.168.1.1 255.255.255.0
no sh
阅读(1079) | 评论(0) | 转发(0) |