The general situation is as follows, the school Network Center is zoned to the school building an IP segment 192.168.101.0/24, each office to run the classroom has several network modules to connect the corridor switch, All through 192.168.101.254 access to other networks and the Internet, there are individual classrooms have dozens of computers, through the switch to the Wall network module, also use 192.168.101.254 as a gateway. This semester expansion of the experimental center, add 200 computers, and formally put into use, but the center of the routing equipment has not yet, all the total of more than 400 computers are in a network, and to the Internet, more than 200 IP is far from enough, there are nearly half of the computer can not get IP from the DHCP server and can not access the Internet situation.
Because more suddenly, too late to plan the intranet to solve the IP resource is not enough, so think of the use of iptables forwarding function, temporarily resolved a network of IP resources is not enough:
1, the network section of a software FTP to add an IP
Ifconfig eth0:1 192.168.0.1
2, open the Iptables service, and add the necessary modules
/etc/init.d/iptables start
Insmod Iptables_nat_ftp (remember not disgrace son, anyway is related to FTP forwarding module)
3. Add rules
Iptables-t nat-a postrouting-o eth0:1-j Masquerade
4, modify the DHCP server IP for 192.168.0.2, and new IP domain 192.168.0.0/24
Now OK, the original has been divided into the IP has 8 days of lease, plus the 192.168.0.0/24 section of more than 200 IP, temporarily resolved 400 machines of the internet problem.