2006-11-8, 01:28(-08), jeniffer:
> 1) Can we delete more than one rules in iptables in 1 go?
> manpage of iptables says that the deletion command syntax is:
> -D chain Rule-spec/-D chain Rulenum
> can we have more than one rule numbers in the command ?Please give an
> example.
No
> 2) Can we add more than one rule in a single commandline?
No
> Is it never
> possible?
Use chains if your purpose is to add 2 rules at the same time to
make sure no packet arrives inbetween the addition of the rules.
> I know the case when hostnames resolve to multiple ip
> addresses,but here we are adding just one rule only.Can we add many
> rules in a single commandline?
Even when hostnames resolve to two addresses, iptables will
send two requests to the kernel, so there may a tiny delay
between the two.
> 3) In the case when hostnames resolve to multiple ip addresses ,are the
> rules that get formed always one after another in the iptable inside
> the kernel?
Yes, though the order in which they are inserted depends on
whether you used -A or -I.
> 4) The man page says that after the --sport one can specify a port
> number or a service name.What will happen if the service name resolves
> to multiple ports?Are many rules added in this case?
There should be only one port per protocol+service-name. If
there are multiple, I guess the first one is used (the one
returned by getservbyname(servicename, protocol).
--
Stéphane
|