1. 修改转发配置文件
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
2. 配置文件生效
sysctl -p
3. 配置防火墙
--add-forward-port=port=<portid>[-<portid>]:proto=<protocol>[:toport=<portid>[-<portid>]][:toaddr=<address>[/<mask>]]
firewall-cmd --add-masquerade --permanent
firewall-cmd --permanent --zone=public --direct --add-rule ipv4 filter FORWARD 0 -d 0.0.0.0/0 -j ACCEPT
firewall-cmd --permanent --zone=public --add-forward-port=port=8081:proto=tcp:toport=8081:toaddr=10.101.1.152
firewall-cmd --reload
firewall-cmd --list-all