奇科電腦 回奇科電腦首頁奇科電腦LPI課程資訊奇科電腦Embedded課程資訊奇科電腦Cisco課程資訊奇科電腦Programming課程資訊奇科電腦Smartphone App課程資訊
Tech Tips4  How to configure Linux machine as IP sharing?

Author: Ben|Date: 2007/06/07|Back to Tech Tips

We can use iptables to configure Linux machine as IP sharing:

Environment: Linux has two NICs: eth0 and eth1, which are connected to external network and internal network respectively. Internal network IP address: 192.168.1.0/24.

Rule:

#iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
#echo "1" > /proc/sys/net/ipv4/ip_forward


Best Browse: 1024x768 Copyright 2010 GeeGo Systems, Ltd.
service@geego.com.tw|DL: 0800-296-296|3F., No.60, Zhulun St., Zhongshan Dist., Taipei City 104, Taiwan (R.O.C.)|02-2711-6373