今天我们学习zabbix网络设备监控的配置
拓扑图

这里我们需需要要运用到GNS3这款软件作为辅助,安装完GNS3后需要添加上一个三层交换机。
开始配置
先远程连接R1机,选择Telnet模式主机为127.0.0.1,端口为2001
先进入全局模式
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.启用ip路由
R1(config)#ip routing配置端口ip并打开
R1(config)#int f0/0
R1(config-if)#no swit
R1(config-if)#no switchport
R1(config-if)#
R1(config-if)#ip add
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config)#int f0/1
R1(config-if)#
R1(config-if)#
R1(config-if)#no swi
R1(config-if)#no switchport
R1(config-if)#
R1(config-if)#
R1(config-if)#ip ad
R1(config-if)#ip add
R1(config-if)#ip address 10.0.0.1 255.255.255.252
R1(config-if)#
R1(config-if)#no shu
R1(config-if)#no shutdown 配置静态ip路由,这条命令告诉 R1: 要到达 192.168.2.0/24 这个网络,需要将数据包发送给 10.0.0.2 这个地址。
R1(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.2查看 R1 的路由表
R1(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set10.0.0.0/30 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, FastEthernet0/1
C 192.168.1.0/24 is directly connected, FastEthernet0/0
S 192.168.2.0/24 [1/0] via 10.0.0.2综上R2的配置同理
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#
R2(config)#ip routi
R2(config)#ip routing
R2(config)#
R2(config)#
R2(config)#
R2(config)#int f0/0
R2(config-if)#
R2(config-if)#no swi
R2(config-if)#no switchport
R2(config-if)#
R2(config-if)#
R2(config-if)#ip add
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#
R2(config-if)#
R2(config-if)#no shu
R2(config-if)#no shutdown
R2(config-if)#
*Mar 1 00:40:55.807: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
R2(config)#
R2(config)#int f0/1
R2(config-if)#
R2(config-if)#no swi
R2(config-if)#no switchport
R2(config-if)#
R2(config-if)#
R2(config-if)#ip add
R2(config-if)#ip address 10.0.0.2 255.255.255.252
R2(config-if)#
R2(config-if)#no shu
R2(config-if)#no shutdown
R2(config-if)#
*Mar 1 00:41:35.123: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config-if)#exit
R2(config)#
R2(config)#
R2(config)#ip route
% Incomplete command.R2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1
R2(config)#
R2(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set10.0.0.0/30 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, FastEthernet0/1
S 192.168.1.0/24 [1/0] via 10.0.0.1
C 192.168.2.0/24 is directly connected, FastEthernet0/0测试用虚拟机ping内部的每个端口ip,如果都能ping通则无误
虚拟机
加个主机(作为监控,可监控其他主机,这台主机要安装zabbix。安装流程见上一课)
网页访问:192.168.1.2:8080 (出现zabbix网页)
