字體:  

讓兩台電腦同時上網的設定...For Linux

adj 發表於: 2007-11-29 16:50 來源: ADJ網路控股集團


NAT要改兩個地方:
vi /etc/sysctl.conf
內容: 把net.ipv4.ip_forward改成1..代表開啟..可以做NAT

QUOTE:

# Disables packet forwarding
net.ipv4.ip_forward = 1
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Disables the magic-sysrq key
#kernel.sysrq = 0
設定iptables:

QUOTE:

iptables -A POSTROUTING -t nat -s 192.168.0.0/255.255.255.0 -j MASQUERADE
這樣就行囉...
忘了還有一個設定:
(1)cd /etc/sysconf
(2)vi network
(3)將FORWARD_IPV4改成true

QUOTE:

NETWORKING=yes
HOSTNAME=localhost.localdomain
DOMAINNAME=localdomain
FORWARD_IPV4=true
這樣就可以囉..