分享
 
 
 

Linux防火墙入门:ipchainsmanpage

王朝system·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

ipchains 的 manpage

IPCHAINS(8) IPCHAINS(8)

NAME

ipchains - IP firewall administration

SYNOPSIS

ipchains -[ADC] chain rule-specification [options]

ipchains -[RI] chain rulenum rule-specification [options]

ipchains -D chain rulenum [options]

ipchains -[LFZNX] [chain] [options]

ipchains -P chain target [options]

ipchains -M [ -L | -S ] [options]

DESCRIPTION

Ipchains is used to set up, maintain, and inspect the IP

firewall rules in the Linux kernel. These rules can be

dividedinto 4 different categories: the IP input chain,

the IP output chain, the IP forwardingchain,and user

defined chains.

For each of these categories, a separate table of rules is

maintained, any of which might refer to one of the user-

defined chains.See ipfw(4) for more details.

TARGETS

A firewall rule specifies criteria for a packet, and a

target.If the packet does not match, the next rule in

the chain is the examined; if it does match, then the next

rule is specified by the value of the target, which can be

the name of a user-defined chain, or one of the special

values ACCEPT, DENY, REJECT, MASQ, REDIRECT, or RETURN.

ACCEPT means to let the packet through. DENYmeans to

drop the packet on the floor. REJECT means the same as

drop, but is more polite and easier todebug,since an

ICMP message is sent back to the sender indicating that

the packet was dropped.(Note that DENY and REJECT are

the same for ICMP packets). [Note: this is incorrect; set-

ting ICMP to REJECT will cause ICMP port unreachables to

be sent!]

MASQ is only legal for theforward and user defined

chains, and can only be used when the kernel is compiled

with CONFIG_IP_MASQUERADE defined. With this, packets

will be masqueraded as if they originated from the local

host. Furthermore, reverse packets will be recognized as

such and they will be demasqueraded automatically, bypass-

ing the forwarding chain.

REDIRECT is only legal for the input and user-defined

chains and can only be used when the Linux kernel is com-

piled with CONFIG_IP_TRANSPARENT_PROXY defined. With

this, packets will be redirected to a local socket, even

if they were sent to a remote host. If the specified

redirection port is 0, which isthe default value, the

destination port of a packet will be used as the redirec-

tion port. When this target is used, an optional extra

argument (the port number) can be supplied.

If theend of a user-defined chain is reached, or a rule

February 8, 19981

IPCHAINS(8) IPCHAINS(8)

with target RETURN is matched, then the next rule in the

previous (calling) chain is examined. If the end of a

builtin chain is reached, or a rule ina builtin chain

with target RETURN is matched, the target specified by the

chain policy determines the fate of the packet.

OPTIONS

The options that are recognized by ipchains can be divided

into several different groups.

COMMANDS

These options specify the specific action to perform; only

one of them can be specified on the command line, unless

otherwise specified below. For all the long versions of

the command and option names, you only need to use enough

lettersto ensure that ipchains can differentiate it from

all other options.

-A, --append

Append one or more rules to the end of the selected

chain. When the source and/or destination names

resolve to more than one address, a rule will be

added for each possible address combination.

-D, --delete

Delete one or more rules from the selected chain.

There are two versions of this command:the rule

can be specified as a number in the chain (starting

at 1 for the first rule) or a rule to match.

-R, --replace

Replace a rule in the selected chain. If the

source and/or destination names resolve to multiple

addresses, the command will fail. Rulesare num-

bered starting at 1.

-I, --insert

Insert one or more rules in the selected chain as

the given rule number. So, if the rule number is

1, the rule or rules are inserted at the head of

the chain.

-L, --list

List all rules in the selected chain. If no chain

is selected, all chains are listed. It is legal to

specify the -Z (zero) option as well, in which case

no chain may be specified. The exact output is

effected by the other arguments given.

-F, --flush

Flush the selected chain. This is equivalent to

deleting all the rules one by one.

February 8, 19982

IPCHAINS(8) IPCHAINS(8)

-Z, --zero

Zero the packet and byte counters in all chains.

It is legal to specify the -L, --list (list) option

as well, to see the counters immediately before

they are cleared; if this is done, then no specific

chain can be specified (they will all be displayed

and cleared.

-N, --new-chain

Create a new user-defined chain of the given name.

There must be no target of that name already.

-X, --delete-chain

Delete the specified user-defined chain. There

must be no references to the chain (if there are

you must delete or replace the referring rules

before the chain can be deleted). If no argument

is given, it will attempt to delete every non-

builtin chain.

-P, --policy

Set the policy for the chain to the given target.

See thesection TARGETS for the legal targets.

Only non-userdefined chains can have policies, and

neither built-in nor user-defined chains can be

policy targets.

-M, --masquerading

This option allows viewing of the currently mas-

queradedconnections (in conjuction with the -L

option) or to set the kernel masqerading parameters

(with the -S option).

-S, --set tcp tcpfin udp

Change the timeout values used for masquerading.

This command always takes 3 parameters, represent-

ing thetimeout values (in seconds) for TCP ses-

sions, TCP sessions after receiving a FIN packet,

and UDPpackets, respectiv

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有