Linux Gateway
posted on 13 Sep 2006 00:52 by charinการใช้ Linux ในตระกูลของ Redhat คือ Fedora core , Linux Tle , SIS Linux การทำเป็น Gateway นั้นเซ็ตไม่ค่อยยาก เซ็ตเพียงไม่กี่บรรทัดก็ใช้ได้แล้ว
- echo 1 > proc/sys/net/ipv4/ip_forward
- iptables -t nat -A POSTROUTING -s (ip,network ex. 192.168.1.0/24) -o eth0 -j MASQUERADE
- service iptables save บันทึกค่า iptables ไว้หน่อย
- แก้ไขค่า /etc/sysctl.conf จาก net.ipv4.ip_forward=0 เปลี่ยนค่าให้ =1 แทน
- service iptables restart รีสตาร์ท iptables ใหม่อีกครั้ง
เท่านี้ก็ได้ Gateway เรียบร้อยแล้ว ชี้ค่า Gateway มายังหมายเลข ip ของเครื่องแม่ข่ายนี้ก็เป็นอันใช้ได้
#1 By preeda (203.147.21.101) on 2008-07-01 10:31