LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 821|回复: 7

我的 /etc/rc.d/rc.local 不能自动启动啊~~

[复制链接]
发表于 2005-1-2 14:40:55 | 显示全部楼层 |阅读模式
我在 /etc/rc.d 目录下
#touch gw
然后 chmod u+x gw

我自行启动 ./gw 没有问题,,

我想让这个gw开机的时候自己启动,,我在/etc/rc.d/rc.local 里面加入一行 /etc/rc.d/gw

reboot 机器,,可是就是不能启动啊~

路径检查几次,都没有错..

大家帮我看看罗
发表于 2005-1-2 15:13:06 | 显示全部楼层
chrmod a+x gw
发表于 2005-1-2 15:14:03 | 显示全部楼层
全部加上x权限试试,不要只加u
发表于 2005-1-2 15:24:03 | 显示全部楼层
. /etc/rc.d/gw
另外你的gw中写的是什么?
 楼主| 发表于 2005-1-3 21:55:15 | 显示全部楼层
Post by 6692975
. /etc/rc.d/gw
另外你的gw中写的是什么?



[root@gw rc.d]# vi gw

/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe iptable_nat
/sbin/iptables -F
/sbin/iptables -F -t nat
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT

/sbin/iptables -A FORWARD -s 0/0 -d 0/0 -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -s 0/0 -d 0/0 -o eth1 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 219.129.238.* -o eth1 -j SNAT --to 219.129.238.*
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 219.129.238.* -o eth1 -j SNAT --to 219.129.238.*


/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 8801 -j DNAT --to-destination 192.168.1.254:8801

/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 8039 -j DNAT --to-destination 192.168.1.39:3389

/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 6254 -j DNAT --to-destination 192.168.1.254:6254
/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 8168 -j DNAT --to-destination 192.168.1.168:3389

/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 8888 -j DNAT --to-destination 192.168.0.88:3389
/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 8018 -j DNAT --to-destination 192.168.0.18:8018
/sbin/iptables -t nat -A PREROUTING -p tcp -d 219.129.238.* --dport 8168 -j DNAT --to-destination 192.168.0.168:3389

只是一个iptables...做NAT上网的~~ 可以执行,,没有问题,就是不能自动启动
发表于 2005-1-4 00:01:14 | 显示全部楼层
是    . /etc/rc.d/gw   这么写的么?
我测试了下 没什么问题阿。
 楼主| 发表于 2005-1-5 02:08:34 | 显示全部楼层
我换了rh7.2 ,,, 用我原来的方法,,通过了,,不知道是不是机器不支持fedora code 3 呢? 机器配置低一点~~
发表于 2005-1-5 04:19:22 | 显示全部楼层
看看日志说了什么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表