IP Masquerade
It is a network function provided by Linux, the biggest benefit is: through a legal IP,
Connect some machines that do not have official IP to the Internet, such as: Dialing online through a Linux machine,
And bring the entire local area network into the Internet.
For example, a local area network 192.168.100.0, there is a Linux machine 192.168.100.10,
After dialing, IP Masquerade can be implemented by the following instructions:
# Cause all hosts on the 192.168.100 / 24 network to be masqueraded.
Ipfwadm -f -p Deny
IPFWADM-F -A M -S 192.168.100.0/24 -D 0.0.0.0.0
Join support for other protocols, for example:
Modprobe ip_masq_ftp
Modprobe ip_masq_raudio
Modprobe ip_masq_irc
This way, IP Masquerade can be implemented.
However, you should pay attention to the following points:
1. Determine that Kernel supports IP Masquerade, which is supported by Slackware 3.5 and RedHat5.1 by default.
Config_experimental
CONFIG_NET
Config_firewall
CONFIG_INET
Config_ip_forward
Config_ip_firewall
Config_ip_masquerade
Config_ip_always_defrag
A total of more than the above, with reference to Kernel-HOWTO.
2, redhat in / etc / sysconfig / network's Forward_IPv4 is set to YES.
3, the Linux machine should be able to PING Tongwang and Internet.
If you can't, you should look at the Route settings.
Route Add -Net 192.168.100.0 Netmask 255.255.255.0 Eth0
Route Add Default PPP0
4, 24 of IPFWADM Corresponds to Netmask, as follows:
Netmask | X | SUBNET
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
255.0.0.0 | 8 | Class A
255.255.0.0 | 16 | CLASS B
255.255.255.0 | 24 | Class C
255.255.255.255 | 32 | Single machine
5, other machine TCP / IP in the LAN Gateway should be set to the IP address of the Linux machine, DNS
Server can be set to any available DNS Server address, such as 202.96.0.133, and the like.
Please note the above points, look more about IP Masquerade Howto.
Because I use Linux time no longer, if I don't want to point out. I hope to make progress together.