免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: ericchan17
打印 上一主题 下一主题

Running Iptables in linux [复制链接]

论坛徽章:
0
11 [报告]
发表于 2005-04-10 10:57 |只看该作者

Running Iptables in linux

whether i can not run the shell script which i created in the file of /etc/sysconfig/iptables. because there is varaible in it.

So how can we run the shell script which created by ourselves

论坛徽章:
0
12 [报告]
发表于 2005-04-10 11:01 |只看该作者

Running Iptables in linux

i think, /etc/sysconfig/iptables is only a shell script, so you should run it by bash or sh.

for example:

  1. #named test
  2. #! /bin/bash
  3. iptables -vnL
复制代码

that's right, you can run it "./test"
but

  1. #named test
  2. iptables -vnL
复制代码

that's wrong

your shell script didn't have "#! /bin/bash" at the first line

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
13 [报告]
发表于 2005-04-10 11:03 |只看该作者

Running Iptables in linux

  1. chmod u+x /your-iptables-shell
复制代码

excute
  1. sh /your-iptables-shell
复制代码

or
  1. cd /your-iptables-shell-dir
  2. ./your-iptables-shell
复制代码

放哪里都无所谓啊

论坛徽章:
0
14 [报告]
发表于 2005-04-10 11:11 |只看该作者

Running Iptables in linux

you mean i should add the file name of the shell script in the script. what is the meaning of "iptables -vnL"? is it the content of my script.

Now i add "#! /bin/bash" at the first line, and i type "chmod 700 iptables" and "./iptables" to run it.

there is no response for my computer. whether i should wait for long time to reply.

论坛徽章:
0
15 [报告]
发表于 2005-04-10 11:15 |只看该作者

Running Iptables in linux

no no no !!!
说英文好费劲……
你的脚本执行了iptables,而恰恰你的脚本名字也叫iptables,因此实际上进入了一个无穷递归循环嵌套
你把脚本名字改为firewall试试

论坛徽章:
0
16 [报告]
发表于 2005-04-10 11:23 |只看该作者

Running Iptables in linux

that is still the same.

When i type "chmod 700 firewall" and "./firewall". there is only show:ip_conntrack version 2.1 (256 buckets,2048 max) -292 bytes per conntrack, and there is no response

论坛徽章:
0
17 [报告]
发表于 2005-04-10 11:50 |只看该作者

Running Iptables in linux

你是在LINUX本机上操作的,还是通过ssh或telnet过去的
如果是后者,所谓的“无反映”现象实际是被你的FIREWALL脚本拦截住了

还是那句话,你首先要知道自己想干什么

论坛徽章:
0
18 [报告]
发表于 2005-04-10 11:57 |只看该作者

Running Iptables in linux

i am sure i operate it in the linux. i create the virual machine of linux through using vmware. And i am sure what i want to do.

Now i attempt to use iptables-save and iptables-restore to run it. if it can not run, i will jump into river.(joking)

论坛徽章:
0
19 [报告]
发表于 2005-04-10 12:08 |只看该作者

Running Iptables in linux

troubleshooting一个脚本是很困难的,尤其是一个自己不知道功能和需求的shell

你首先要知道自己要干什么,然后自己写,这样最好,别人的shell不一定适用于你

论坛徽章:
0
20 [报告]
发表于 2005-04-10 12:17 |只看该作者

Running Iptables in linux

platinum, thank you.

It is my first time to using iptables to configure home network. it is normal that i can not write the script by myself. however i have understood the script and modified the script to meet my demand.

platinum, thank you very much for your kindly help.

Now i use iptables-save and iptables-restore to run it successfully.

Cheers
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP