感谢Hengjiu提供本站空间。
分页: 1/273 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]
Jun 28
第一步:设置正确的时间和时区

引用
Switch#clock set  00:12:34 28 Jan 2009

Switch(config)#clock timezone BJT +8


第二步:启用log和debug的时间格式
引用
Switch(config)#service timestamps debug datetime msec localtime show-timezone

Switch(config)#service timestamps log datetime msec localtime show-timezone


效果如下:
引用

Jun 28 08:10:03.764 BJT: %SYS-5-CONFIG_I: Configured from console by vty0 (172.16.66.66)
Tags: , , ,
Jun 26
ARP 地址攻击查找流程
1 如果客户端PC与网关无法通讯,首先在客户端ping 网关地址后,然后在dos窗口下执行 arp –a 查看网关的mac地址,记录下网关MAC地址。到交换机上查找交换机的MAC地址(例如VLAN1接口)
执行 show int vlan 1 查看输出信息中VLAN1接口MAC,同时执行 show standby vlan 1 查看HSRP网关MAC地址。如果客户端显示的mac(假设为00-0d-0a-ac-bc-78)地址与网关地址不同,则可能是网关的MAC遭到ARP 病毒攻击。到交换机上执行show mac-address | in 000d.0aac.bc78 在输入信息中查找关联该MAC地址的端口,如果该端口是直连PC或者SERVER的端口,那么该端口所连客户端可能感染ARP类病毒。如果该端口连接的是另外一台交换机,那么登陆到那台交换机上执行show mac-address | in 000d.0aac.bc78 直到关联端口是直连PC的端口位置。

2 如果客户端PC能够PING 通网关但是与其他VLAN的机器PING(假设该地址为192.168.1.111)不通。首先在客户端ping 192.168.1.111后,然后在dos窗口下执行 arp –a 查看对方IP地址对应的mac地址,记录下其MAC地址(有可能没有信息),同时在目标机器192.168.1.111上执行 ipconfig/all查看该机器网卡mac地址并记录下(注意:交换机上显示的MAC地址和PC上显示的MAC地址格式不一样,交换机上为4个16进 制数一组并以“.”分割,PC机上为2个16进制数为一组以”-”分割)。在dos窗口下执行 tracert –d 192.168.1.111。查看tracert信息最后一跳到达哪台交换机。登陆到那台交换机上执行PING 192.168.1.111,然后执行 show arp | in 192.168.1.111 查看输出信息的mac地址与目标机器(192.168.1.111)的mac地址是否相同。如果不同(假设显示为 000a.da87.5bca),记录下后执行 show mac-address | in 000a.da87.5bca 在输出信息查看该MAC地址关联到哪个端口,如果关联的端口连接到另外一台交换机上则到那台交换机上执行show mac-address | in 000a.da87.5bca,最终找到关联端口连接是最终客户端(PC或者server)的端口,如果该端口不是真正连接192.168.1.111的 端口通常该端口既是感染ARP类病毒的机器。在交换机上执行 show arp | in 000a.da87.5bca 输入信息通常会显示该MAC会关联多个IP地址。

流量攻击型病毒的查找流程
如果局域网中通讯不正常、丢包严重,登陆到网关上也会延迟很大,通常是局域网中有机器感染了流量攻击型病毒,该类病毒会发送大量的小字节数据包消耗网络中交换机、路由器的带宽和 处理能力。查找该类病毒也是通过流量判断攻击来源。在核心交换机上执行clear count 清除当前各个接口上的流量信息,20秒钟后执行show interface 查看各个接口上的流量(数据包的数量、总字节数)通常会有一个或几个端口的数据包的数量相当夸张,但是总字节数不一定很多。如果这个端口直连PC那么暂时 拔下该端口网线查看网络是否回复正常。如果该端口是连接另外一台交换机那么登陆到那台交换机上依次操作,先清空各个端口的统计数字,20秒钟后检查接口流量。直到找到直连PC而且流量相当大的机器。

Tags: , , ,
Jun 26
查ARP病毒的时候需要查找是谁伪装成网关的,ping网关地址后arp -a就可以查看到MAC了。

如何查找MAC所对应的某个端口?登陆到Access Switch上用以下命令查找:

引用
Switch#show mac-address-table | include 001c.2503.a102


需要特别注意的是MAC必须小写,我之前就犯这个错误,找了半天也找不到。

可能是因为IOS是基于UNIX开发的原因吧。

另外,如果找到的端口不是连接在Host上,而是另外一台交换机。那么请登陆到另外一台交换机继续用上面的命令查询,直到这个端口连接的是Host为止,这样就可以找到谁伪装成网关了。
Tags: , , , ,
Jun 26
转载自:http://www.techkuma.com/archives/307

网络工程师拿到一台新的交换机时,往往忽视了初始配置的重要性,自己做了以下总结,以cisco3750为例

找了一台试验的交换机

1.清除配置

#erase nvram:
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete

或者erase startup-config

no save

#reload
Proceed with reload? [confirm]


2.用户权限

Would you like to enter the initial configuration dialog? [yes/no]: no

Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#hostname test

test(config)#username cisco secret cisco(设置多用户日志就能区分谁做的修改,不用password增加安全性)

test(config)#enable secret cisco(设置特权密码,不用password增加安全性)

注:没必要用service password-encryption这种加密方式很弱,很容易被破解,不如secret的MD5加密方式安全

配置登陆终端

test(config)#line con 0

test(config-line)#logg sy

test(config-line)#exec-timeout 0 0

test(config-line)#password cisco

test(config-line)#line vty 0 4

test(config-line)#exec-timeout 6 0

test(config-line)#password cisco

test(config-line)#access-class 5 in (访问控制用限制访问IP)

exit

test(config)s#ervice tcp-keepalives-in  (防止有些用户进程掉死但是还占用vty 端口的情况)

test(config)#access-list 5 permit 172.16.1.1 log(可访问的ip或者ip段并且记录日志)

test(config)#access-list 5 deny any

3.关闭有安全隐患的小服务

test(config)#no ip http server   //禁用http server,这玩意儿的安全漏洞很多的

test(config)#no ip source-route   //禁用IP源路由,防止路由欺骗

test(config)#no service finger //禁用finger服务

test(config)#no ip bootp server   //禁用bootp服务

test(config)#no service udp-small-s //小的udp服务

test(config)#no service tcp-small-s //禁用小的tcp服务

test(config)#no cdp run //禁掉CDP

test(config)#control-plane police //预防DDOS攻击

这就是所有步骤,之后就可以配置路由和交换了

sh run完整配置

引用

test#sh run
Building configuration…

01:06:23: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 1670 bytes
!
version 12.2
no service pad
service tcp-keepalives-in
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname test
!
enable secret 5 $1$BBBP$59T6b2xscXmSPaxoBzmZw/
!
username cisco secret 5 $1$VM10$fCfMHzL2SRqleS7SLJHB2/
no aaa new-model
switch 1 provision ws-c3750-24ts
vtp domain cisco
vtp mode transparent
ip subnet-zero
no ip domain-lookup
!
!
!
!
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!

!
!
interface FastEthernet1/0/1
!
interface FastEthernet1/0/2
!
interface FastEthernet1/0/3
!
interface FastEthernet1/0/4
!
interface FastEthernet1/0/5
!
interface FastEthernet1/0/6
!
interface FastEthernet1/0/7
!
interface FastEthernet1/0/8
!
interface FastEthernet1/0/9
!
interface FastEthernet1/0/10
!
interface FastEthernet1/0/11
!
interface FastEthernet1/0/12
!
interface FastEthernet1/0/13
!
interface FastEthernet1/0/14
!
interface FastEthernet1/0/15
!
interface FastEthernet1/0/16
!
interface FastEthernet1/0/17
!
interface FastEthernet1/0/18
!
interface FastEthernet1/0/19
!
interface FastEthernet1/0/20
!
interface FastEthernet1/0/21
!
interface FastEthernet1/0/22
!
interface FastEthernet1/0/23
!
interface FastEthernet1/0/24
!
interface GigabitEthernet1/0/1
!
interface GigabitEthernet1/0/2
!
interface Vlan1
no ip address
!
ip classless
no ip http server
!
!
access-list 5 permit 172.16.1.1 log
no cdp run
!
control-plane
!
!
line con 0
exec-timeout 0 0
password cisco
logging synchronous
line vty 0 4
access-class 5 in
exec-timeout 6 0
password cisco
no login
line vty 5 15
no login
!
!
end
Tags: , , ,
Jun 26
一、交换机支持的命令

交换机基本状态
引用

switch: ;ROM状态, 路由器是rommon>
hostname> ;用户模式
hostname# ;特权模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;接口状态


交换机口令设置
引用

switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname  ;设置交换机的主机名
switch(config)#enable secret xxx ;设置特权加密口令
switch(config)#enable password xxa ;设置特权非密口令
switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4 ;进入虚拟终端
switch(config-line)#login ;允许登录
switch(config-line)#password xx ;设置登录口令xx
switch#exit ;返回命令


交换机VLAN设置
引用

switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2
switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan
switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继
switch(config)#vtp domain  ;设置发vtp域名
switch(config)#vtp password  ;设置发vtp密码
switch(config)#vtp mode server ;设置发vtp模式
switch(config)#vtp mode client ;设置发vtp模式


交换机设置IP地址
引用

switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address   ;设置IP地址
switch(config)#ip default-gateway  ;设置默认网关
switch#dir flash: ;查看闪存


交换机显示命令
引用

switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息    




二、路由器支持的命令
路由器显示命令
引用

router#show run ;显示配置信息
router#show interface ;显示接口信息
router#show ip route ;显示路由信息
router#show cdp nei ;显示邻居信息
router#reload     ;重新起动


路由器口令设置
引用

router>enable ;进入特权模式
router#config terminal ;进入全局配置模式
router(config)#hostname  ;设置交换机的主机名
router(config)#enable secret xxx ;设置特权加密口令
router(config)#enable password xxb ;设置特权非密口令
router(config)#line console 0 ;进入控制台口
router(config-line)#line vty 0 4 ;进入虚拟终端
router(config-line)#login ;要求口令验证
router(config-line)#password xx ;设置登录口令xx
router(config)#(Ctrl+z) ; 返回特权模式
router#exit ;返回命令


路由器配置
引用

router(config)#int s0/0 ;进入Serail接口
router(config-if)#no shutdown ;激活当前接口
router(config-if)#clock rate 64000 ;设置同步时钟
router(config-if)#ip address   ;设置IP地址
router(config-if)#ip address  second ;设置第二个IP
router(config-if)#int f0/0.1 ;进入子接口
router(config-subif.1)#ip address  ;设置子接口IP
router(config-subif.1)#encapsulation dot1q  ;绑定vlan中继协议
router(config)#config-register 0x2142 ;跳过配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引导


路由器文件操作
引用

router#copy running-config startup-config ;保存配置
router#copy running-config tftp ;保存配置到tftp
router#copy startup-config tftp ;开机配置存到tftp
router#copy tftp flash: ;下传文件到flash
router#copy tftp startup-config;下载配置文件

ROM状态:

Ctrl+Break ;进入ROM监控状态

rommon>confreg 0x2142 ;跳过配置文件

rommon>confreg 0x2102 ;恢复配置文件

rommon>reset  ;重新引导

rommon>copy xmodem: flash: ;从console传输文件

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP

rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码

rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP

rommon>TFTP_FILE=c2600.bin ;指定下载的文件

rommon>tftpdnld ;从tftp下载

rommon>dir flash: ;查看闪存内容

rommon>boot ;引导IOS


静态路由
引用

ip route    ;命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例


动态路由
引用

router(config)#ip routing ;启动路由转发
router(config)#router rip ;启动RIP路由协议。
router(config-router)#network  ;设置发布路由
router(config-router)#negihbor  ;点对点帧中继用。


帧中继命令
引用

router(config)#frame-relay switching ;使能帧中继交换

router(config-s0)#encapsulation frame-relay ;使能帧中继

router(config-s0)#fram-relay lmi-type cisco ;设置管理类型

router(config-s0)#frame-relay intf-type DCE ;设置为DCE

router(config-s0)#frame-relay dlci 16 ;

router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号

router(config-s0)#frame-relay interface-dlci 16 ;

router(config)#log-adjacency-changes ;记录邻接变化

router(config)#int s0/0.1 point-to-point ;设置子接口点对点

router#show frame pvc ;显示永久虚电路

router#show frame map ;显示映射


基本访问控制列表
引用

router(config)#access-list  permit|deny  

router(config)#interface  ;default:deny any

router(config-if)#ip access-group  in|out ;default:out
例1:

router(config)#access-list 4 permit 10.8.1.1

router(config)#access-list 4 deny 10.8.1.0 0.0.0.255

router(config)#access-list 4 permit 10.8.0.0 0.0.255.255

router(config)#access-list 4 deny 10.0.0.0 0.255.255.255

router(config)#access-list 4 permit any

router(config)#int f0/0

router(config-if)#ip access-group 4 in


扩展访问控制列表
引用

access-list  permit|deny icmp  
wild>[type]

access-list  permit|deny tcp  
wild>[port]

例3:

router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo

router(config)#access-list 101 permit ip any any

router(config)#int s0/0

router(config-if)#ip access-group 101 in

例3:

router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80

router(config)#access-list 102 permit ip any any

router(config)#interface s0/1

router(config-if)#ip access-group 102 out


删除访问控制例表
引用

router(config)#no access-list 102

router(config-if)#no ip access-group 101 in


路由器的nat配置
引用

Router(config-if)#ip nat inside ;当前接口指定为内部接口

Router(config-if)#ip nat outside ;当前接口指定为外部接口

Router(config)#ip nat inside source static [p] <私有IP><公网IP> [port]

Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1

Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80

Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0

Router(config)#ip nat inside source list 1 pool p1

Router(config)#ip nat inside destination list 2 pool p2

Router(config)#ip nat inside source list 2 interface s0/0 overload

Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary

Router#show ip nat translation

rotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。

overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。


外部网关协议配置
引用

routerA(config)#router bgp 100

routerA(config-router)#network 19.0.0.0

routerA(config-router)#neighbor 8.1.1.2 remote-as 200


配置PPP验证
引用

RouterA(config)#username  password

RouterA(config)#int s0

RouterA(config-if)#ppp authentication {chap|pap}



三、PIX防火墙命令
引用

Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别

Pix525(config)#interface ethernet0 auto ;设置接口方式

Pix525(config)#interface ethernet1 100full ;设置接口方式

Pix525(config)#interface ethernet1 100full shutdown

Pix525(config)#ip address inside 192.168.0.1 255.255.255.0

Pix525(config)#ip address outside 133.0.0.1 255.255.255.252

Pix525(config)#global (if_name) natid ip-ip ;定义公网IP区间

Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句

Pix525(config)#global (outside) 1 133.0.0.1 ;例句

Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉设置
Pix525(config)#nat (if_name) nat_id local_ip [netmark]

Pix525(config)#nat (inside) 1 0 0

内网所有主机(0代表0.0.0.0)可以访问global 1指定的外网。

Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0

内网172.16.5.0/16网段的主机可以访问global 1指定的外网。
Pix525(config)#route if_name 0 0 gateway_ip [metric] ;命令格式

Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句

Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句
Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8

表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址。
Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8

中间区域ip地址172.16.0.8,访问外部时被翻译成133.0.0.1全局地址。



Tags: ,
分页: 1/273 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]