**本实验是在zabbix已经安装配置好的基础上开始做的:
基础实验配置请参考:https://mp.youkuaiyun.com/mdeditor/81736380**
在真机添加策略:
[root@foundation38 Desktop]# iptables -t nat -I POSTROUTING -s 172.25.38.0/24 -j MASQUERADE
在企业7的主机进行配置:
[root@localhost zabbix]# ls
web zabbix_java_gateway.conf zabbix_server.conf
zabbix_agentd.conf zabbix_java_gateway_logback.xml
zabbix_agentd.d zabbix_proxy.conf
[root@localhost zabbix]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.0.0 0.0.0.0 255.255.0.0 U 100 0 0 eth0
[root@localhost zabbix]# route add default gw 172.25.38.250 添加网关
[root@localhost zabbix]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.25.38.250 0.0.0.0 UG 0 0 0 eth0
172.25.0.0 0.0.0.0 255.255.0.0 U 100 0 0 eth0
[root@localhost zabbix]# vim /etc/resolv.conf
[root@localhost zabbix]# cat /etc/resolv.conf
nameserver 114.114.114.114
[root@localhost zabbix]# ping baidu.com 必须保证可以上网
PING baidu.com (220.181.57.216) 56(84) bytes of data.
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=1 ttl=48 time=119