#所有password用思科私有方式加密 系统密码作为可逆密文存储在配置中
conf t
service password-encryption
交换机的端口安全-port-security的概念
1. 通过对限制接口的最大mac数量从而限制接入的主机用户
2. 限定接口所连接的特定MAC,从而实现接入用户的限制
依据: 通过安全地址判断-security MAC address
port-security 安全地址 secure mac address
当我们将接口允许的MAC地址数量设置为1并且为接口设置一个安全地址,那么这个接口将只为该MAC所属的PC服务,也就是源为该MAC的数据帧能够进入该接口
port-security disable
默认的最大允许安全MAC地址数量 1
惩罚模式 shutdown (进入err-disable状态) #除了shutdown模式还有protect和restrict模式
1. 进入接口激活port-security
2. 配置每个接口的安全地址(secure mac address)
3. 配置port-security惩罚机制 shutdown | protect | restrict
4. (选做) 配置安全地址老化时间
tips:f0/1 is a dynamic port
dynamic port不能启用Port Security,只有静态接入端口或中继端口才行。需要将模式切换为access。动态端口是自动识别的,既可以为access,也可以为trunk,所以要设为access模式。
1 Switch(config)#int f0/1
2 Switch(config-if)#switchport mode access
3 Switch(config-if)#switchport access vlan 10
4 % Access VLAN does not exist. Creating vlan 10
5 Switch(config-if)#exit
6 Switch(config)#vlan 10
7 Switch(config-vlan)#exit
8 Switch(config)#vlan 20
9 Switch(config-vlan)#exit
10 Switch(config)#switch access vlan 10
11 ^
12 % Invalid input detected at '^' marker.
13
14 Switch(config)#int f0/1
15 Switch(config-if)#switchport access vlan 10
16 Switch(config-if)#switch port-security
17 Switch(config-if)#do sh port-security int f0/1 #查看接口的port-security状态
18 Port Security : Enabled
19 Port Status : Secure-up
20 Violation Mode : Shutdown #违反策略的惩罚措施
21 Aging Time : 0 mins
22 Aging Type : Absolute
23 SecureStatic Address Aging : Disabled
24 Maximum MAC Addresses : 1 #最大的安全地址个数 默认为1
25 Total MAC Addresses : 0
26 Configured MAC Addresses : 0 #手工静态配置的安全mac地址
27 Sticky MAC Addresses : 0 #sticky的安全地址
28 Last Source Address:Vlan : 0000.0000.0000:0 #最近的一个安全地址+vlan
29 Security Violation Count : 0 #接口历史上出现过的违例次数
1 Switch(config-if)#int f0/1
2 Switch(config-if)#switchport port-security violation restrict
protect :仅丢弃非法数据帧
restrict 丢弃非法数据帧同时产生一个syslog消息
shutdown 端口设置成err-disable,接口不可用 同时产生要给syslog消息
Switch(config-if)#switchport port-security ?
aging Port-security aging commands #老化时间
mac-address Secure mac address #安全mac地址
maximum Max secure addresses # 最大安全地址数量
violation Security violation mode #惩罚措施
Switch(config-if)#switchport port-security maximum 1
1 Switch(config-if)#int f0/1
2 Switch(config-if)#switchport mode access
3 Switch(config-if)#switchport access vlan 10
4 Switch(config-if)#switc
5 Switch(config-if)#switchport port-se
6 Switch(config-if)#switchport port-security maxim
7 Switch(config-if)#switchport port-security maximum 2
8 Switch(config-if)#switchport prot
9 Switch(config-if)#switchport port
10 Switch(config-if)#switchport port-security ?
11 aging Port-security aging commands
12 mac-address Secure mac address
13 maximum Max secure addresses
14 violation Security violation mode
15 <cr>
18 Switch(config-if)#switchport port-security mac-address xx
1 Switch(config-if)#int f0/1
2 Switch(config-if)#switchport mode access
3 Switch(config-if)#switchport access vlan 10
4 Switch(config-if)#switchport port-security maximum 2
5 Switch(config-if)#switchport port-security mac-address sticky 我有一个Ruby程序,它使用rubyzip压缩XML文件的目录树。gem。我的问题是文件开始变得很重,我想提高压缩级别,因为压缩时间不是问题。我在rubyzipdocumentation中找不到一种为创建的ZIP文件指定压缩级别的方法。有人知道如何更改此设置吗?是否有另一个允许指定压缩级别的Ruby库? 最佳答案 这是我通过查看rubyzip内部创建的代码。level=Zlib::BEST_COMPRESSIONZip::ZipOutputStream.open(zip_file)do|zip|Dir.glob("**/*")d
我在使用omniauth/openid时遇到了一些麻烦。在尝试进行身份验证时,我在日志中发现了这一点:OpenID::FetchingError:Errorfetchinghttps://www.google.com/accounts/o8/.well-known/host-meta?hd=profiles.google.com%2Fmy_username:undefinedmethod`io'fornil:NilClass重要的是undefinedmethodio'fornil:NilClass来自openid/fetchers.rb,在下面的代码片段中:moduleNetclass
我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击
我正在编写一个小脚本来定位aws存储桶中的特定文件,并创建一个临时验证的url以发送给同事。(理想情况下,这将创建类似于在控制台上右键单击存储桶中的文件并复制链接地址的结果)。我研究过回形针,它似乎不符合这个标准,但我可能只是不知道它的全部功能。我尝试了以下方法:defauthenticated_url(file_name,bucket)AWS::S3::S3Object.url_for(file_name,bucket,:secure=>true,:expires=>20*60)end产生这种类型的结果:...-1.amazonaws.com/file_path/file.zip.A
我想设置一个默认日期,例如实际日期,我该如何设置?还有如何在组合框中设置默认值顺便问一下,date_field_tag和date_field之间有什么区别? 最佳答案 试试这个:将默认日期作为第二个参数传递。youcorrectlysetthedefaultvalueofcomboboxasshowninyourquestion. 关于ruby-on-rails-date_field_tag,如何设置默认日期?[rails上的ruby],我们在StackOverflow上找到一个类似的问
我正在玩HTML5视频并且在ERB中有以下片段:mp4视频从在我的开发环境中运行的服务器很好地流式传输到chrome。然而firefox显示带有海报图像的视频播放器,但带有一个大X。问题似乎是mongrel不确定ogv扩展的mime类型,并且只返回text/plain,如curl所示:$curl-Ihttp://0.0.0.0:3000/pr6.ogvHTTP/1.1200OKConnection:closeDate:Mon,19Apr201012:33:50GMTLast-Modified:Sun,18Apr201012:46:07GMTContent-Type:text/plain
在Ruby中是否有Gem或安全删除文件的方法?我想避免系统上可能不存在的外部程序。“安全删除”指的是覆盖文件内容。 最佳答案 如果您使用的是*nix,一个很好的方法是使用exec/open3/open4调用shred:`shred-fxuz#{filename}`http://www.gnu.org/s/coreutils/manual/html_node/shred-invocation.html检查这个类似的帖子:Writingafileshredderinpythonorruby?
我在Rails应用程序中使用CarrierWave/Fog将视频上传到AmazonS3。有没有办法判断上传的进度,让我可以显示上传进度如何? 最佳答案 CarrierWave和Fog本身没有这种功能;你需要一个前端uploader来显示进度。当我不得不解决这个问题时,我使用了jQueryfileupload因为我的堆栈中已经有jQuery。甚至还有apostonCarrierWaveintegration因此您只需按照那里的说明操作即可获得适用于您的应用的进度条。 关于ruby-on-r
我正在使用ruby2.1.0我有一个json文件。例如:test.json{"item":[{"apple":1},{"banana":2}]}用YAML.load加载这个文件安全吗?YAML.load(File.read('test.json'))我正在尝试加载一个json或yaml格式的文件。 最佳答案 YAML可以加载JSONYAML.load('{"something":"test","other":4}')=>{"something"=>"test","other"=>4}JSON将无法加载YAML。JSON.load("
我正在尝试为我的iOS应用程序设置cocoapods但是当我执行命令时:sudogemupdate--system我收到错误消息:当前已安装最新版本。中止。当我进入cocoapods的下一步时:sudogeminstallcocoapods我在MacOS10.8.5上遇到错误:ERROR:Errorinstallingcocoapods:cocoapods-trunkrequiresRubyversion>=2.0.0.我在MacOS10.9.4上尝试了同样的操作,但出现错误:ERROR:Couldnotfindavalidgem'cocoapods'(>=0),hereiswhy:U