With the rapid development of Internet, the attacks caused by the IP address leakage become more and more serious. The traditional way to hide the IP address through a proxy server affects the data transmission rate and the proxy server could become the target of attacks easily. In response to this problem, in this paper, the static IP and DHCP dynamic IP information hidden in internal network and external network is implemented respectively based on iptables modules and the IP address substitution technique, through DNAT, SNAT and multiple threads in Linux OS. The experiment shows that it achieves the desired results.