目录
1)GW路由器配置GW路由器配置)
3)syslog配置syslog配置)

实验以上图为网络拓扑图结构
1.首先是搭建环境
首先以CentOS7版本为例,建立GW也就是路由器,然后再建立Server与备份服务器Syslog
2.实现全网互通
1)GW路由器配置

总共设置三个网卡一个链接NAT,一个VMnet1网段,一个VMnet2网段
client客户端在VMnet1网段 192.168.1.0
server服务端在VMnet2网段 172.16.1.0
ip add #查看网卡信息

总共三个网卡,ens32连接NAT,ens33连接VMnet1 192.168.1.0,ens34连接VMnet2 172.16.1.0
cd /etc/sysconfig/network-scripts/
vim ifcfg-ens32

创建出ifcfg-ens32,ifcfg-ens33,ifcfg-ens34配置文件
ifcfg-ens32配置

ifcfg-ens33配置

ifcfg-ens34配置

:wq #末行模式保存
打开网卡服务
sudo ifup ens32
sudo ifup ens33
sudo ifup ens34
打开linux内核的路由转发功能
vim /etc/sysctl.conf

加上net.ipv4.ip_forward=1
2)server配置

进入网卡配置文件

3)syslog配置

实现互通

3.建立日志服务器
1)确定发送端与接受端
server为发送端,syslog为接受端
2)发送端配置(server)
vim /etc/rsyslog.conf

加上上图的转发ip与端口
3)接受端配置(syslog)
vim /etc/rsyslog.conf


这样配置之后sever端的日志就会发到日志服务器上