Get the App
SLTechnology News&Howtos  ›  Servers  › 

NAT mode as egress gateway

Shulou Source: shulou.com Published: 2022-06-03 00:27:41 10月03日 Update

1. Physical topology

2. Host Nic settings

Echo "1" > > / proc/sys/net/ipv4/ip_forward # enable routing forwarding

3. Client network configuration

# set the client ip to 10. Segment and the gateway points to 10.1.1.1

# ping Gateway Test

4. Setting the host NAT rule iptables- t nat-A POSTROUTING-s 10.1.1.1ax 24-j SNAT-- to-source 192.168.0." indicates that a message with the original address of 10.1.1.1Universe 24 network segment has been received and forwarded to 192.168.0.9IP and forwarded to iptables- t nat-nL # View nat rule iptables-save > / etc/sysconfig/iptables # Save rules, this folder will read this rule when the folder system restarts So as to automatically load iptables-restore

Tags: Rules files systems commands manual runs gateways hosts customers clients folders ports scripts methods principles addresses entities messages topologies point to Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia OPPO Reno Redmi Shulou Tech Info MySQL