http://www.revsys.com/writings/quicktips/nat.html

 

https://www.alibabacloud.com/zh/product/nat?spm=a3c0i.7919406.692950.dznavproductsc3.143733e26UobLQ

echo 1 > /proc/sys/net/ipv4/ip_forward

Then you'll need to configure iptables to forward the packets from your internal network, on /dev/eth1, to your external network on /dev/eth0. You do this will the following commands:

# /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# /sbin/iptables -A FORWARD -i eth0 -o eth1 -m state
   --state RELATED,ESTABLISHED -j ACCEPT
# /sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2021-06-15
  • 2021-12-03
  • 2021-04-11
  • 2021-06-24
  • 2021-08-13
  • 2021-12-15
猜你喜欢
  • 2021-04-14
  • 2021-05-27
  • 2021-05-11
  • 2021-09-17
  • 2022-01-11
  • 2021-12-30
  • 2022-12-23
相关资源
相似解决方案