Chinaunix首页 | 论坛 | 博客
  • 博客访问: 105260
  • 博文数量: 17
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 184
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-20 11:19
个人简介

学习内核中~

文章分类

全部博文(17)

文章存档

2013年(17)

我的朋友

分类: 系统运维

2013-06-12 11:07:45

// 设置管理ip
system-view
interface Vlan-interface 1
ip address 192.168.0.1 255.255.255.0
quit
// 设置console口的认证方式,这里是用密码认证,不需要账号
user-interface aux 0
authentication-mode password
set authentication-mode password cipher helloworld
quit
// 创建一个账号,这个账号可以用于ssh,telnet,terminal登录,权限是3,表示最高
local-user jiffies
password cipher helloworld
service-type ssh telnet terminal level 3
quit
// 设置通过远程终端登陆到交换机的认证模式,这里是scheme,即需要账号
user-interface vty 0 4
authentication-mode scheme
quit
// 设置level 3的密码
super password level 3 cipher helloworld
// 开启snmp
snmp-agent

snmp-agent community read public
snmp-agent sys-info version all
// 保存设置
save

因为刚拿到的交换机,之前有人配置过,所以一开始我要清除原本交换机的配置,于是在bootrom里面选择了7.skip current configuration file,可是没想到这个设置是持久有效的,导致我配置好交换机save后重启,每次重启都跳过了配置文件,最后还是得进入bootrom把这个选项设掉。

// vlan配置
system-view
vlan 2                          // 创建一个vlan,id为2
port Ethernet 1/0/24     // 给vlan2分配一个端口,端口号为24
quit
interface Vlan-interface 2
ip address 192.168.2.1 255.255.255.0
undo shutdown

这样vlan2就配置好了,注意vlan1是系统自带的vlan,vlan1不能被删除,所有没有被分配到其他vlan的端口都会默认分配给vlan1。vlan2只有一个24号端口,当一个端口没有其他网络设备和这个端口连通时,端口的状态是DOWN,一个vlan的所有端口中,只要有一个为UP,vlan的状态就为UP,否则为DOWN。可以在以太网端口视图中用shutdown关闭某个端口,这时端口的状态变为 ADMINISTRATIVELY DOWN。
主机1(192.168.0.100/24)-vlan1(192.168.0.1/24)-vlan2(192.168.2.1/24)-主机2(192.168.2.100/24),当把两台主机的防火墙关掉后,互相能ping得通。



阅读(2240) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~