Usually the server will have many blocks of network cards, so it may also be connected to a different network, in the isolated network, some services may need to communicate, when the server is configured to assume the ability to forward the packet.
One, implementing port mappings under Windows Server
1. Querying the port mapping situation
netsh interface portproxy show v4tov4
2. Querying all port mappings for an IP
netsh interface portproxy show v4tov4 | Find "[Destination IP]"
Example: netsh interface portproxy show v4tov4 | Find "192.168.1.1"
3. Add a port mapping
netsh interface portproxy add v4tov4 listenaddress=[extranet IP] listenport=[extranet port] connectaddress=[intranet IP] connectport=[intranet port]
Example: netsh interface portproxy add v4tov4 listenaddress=2.2.2.2 listenport=8080 connectaddress=192.168.1.50 connectport= 80
4. Delete a port mapping
netsh interface portproxy delete v4tov4 listenaddress=[extranet IP] listenport=[external network port]
Example: netsh interface portproxy delete v4tov4 listenaddress=2.2.2.2 listenport=8080
Second, the implementation of port mapping under Linux
1. Allow packet forwarding:
Echo 1 >/proc/sys/net/ipv4/ip_forward
Iptables-t nat-a Postrouting-j Masquerade
2. Set Port forwarding:
Iptables-t nat-a prerouting-p tcp-m TCP--dport [external network port]-j DNAT--to-destination [Intranet address]:[intranet port]
Example: Iptables-t nat-a prerouting-p tcp-m tcp--dport 6080-j DNAT--to-destination 10.0.0.100:6090
3. Save the configuration. If not saved, this mapping will expire after reboot
Service Iptables Save
Implement port mappings on Linux or Windows