查看完整版本: 讓兩台電腦同時上網的設定...For Linux


adj 2007-11-29 16:50

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

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[/quote]

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

[quote]
NETWORKING=yes
HOSTNAME=localhost.localdomain
DOMAINNAME=localdomain
FORWARD_IPV4=true
[/quote]
這樣就可以囉..
頁: [1]
查看完整版本: 讓兩台電腦同時上網的設定...For Linux