|
|
我的机器是FC4, IP是192.168.0.101,
与其他的使用XP的机器在同一局域网内,共用一台交换机,
我想自己拨号,与其他机器共享上网.请问该如何修改/etc//rc.d/rc/local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
######## Nat Server
echo "1" >/proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
iptables -F INPUT
iptables -F FORWARD
iptables -F POSTROUTING -t nat
iptables -P FORWARD DROP
iptables -A FORWARD -s 192.168.0.1/255 -j ACCEPT
iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.1/255 -j MASQUERADE
ifconfig egh0:0 192.168.0.101 netmask 255.255.255.0
iptables -t nat -A POSTROUTING -s 192.168.0.1/255 -j MASQUERADE |
|