[ale] Does anyone know the trick to iptables

George Allen glallen01 at gmail.com
Tue Jan 8 21:08:18 EST 2013


Or:
iptables -S | awk '{x="IPTABLES-Chain-"$2;}{print > x;}'; cat
IPTABLES-Chain-{INPUT,FORWARD} && rm IPTABLES-Chain-*

Same as the last one, except uses -S instead of -L, change the order
of cat *{INPUT,FORWARD} to change the output order.

On Tue, Jan 8, 2013 at 8:42 PM, George Allen <glallen01 at gmail.com> wrote:
> OK (Really, I'm just trying to improve my awk skills...) This should
> do it consistently, at the cost of creating tmp files:
>
> # iptables -L -n | awk '/^Chain/{x="IPTABLES-Chain-"$2;}{print > x;}';
> cat IPTABLES-Chain-{INPUT,FORWARD} && rm IPTABLES-Chain-*
>
> *** note the RM at the end... *** don't cut and paste without a risk
> assessment. :)
>
> On Tue, Jan 8, 2013 at 9:38 AM, Lightner, Jeff <JLightner at water.com> wrote:
>> Interesting idea.  It works so long as OUTPUT follows FORWARD.
>>
>> How would you do it with awk if you wanted say INPUT and FORWARD but NOT output?
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of George Allen
>> Sent: Monday, January 07, 2013 9:27 PM
>> To: Atlanta Linux Enthusiasts
>> Subject: Re: [ale] Does anyone know the trick to iptables
>>
>> iptables -L -n | awk '/FORWARD/,EOF'
>>
>> On Mon, Jan 7, 2013 at 5:39 PM, Chuck Payne <terrorpup at gmail.com> wrote:
>>> Yes, I was getting weird errors. Thanks.
>>>
>>> On Mon, Jan 7, 2013 at 5:34 PM, Scott McBrien <smcbrien at gmail.com> wrote:
>>>> You mean like
>>>> iptables -nL OUTPUT
>>>> iptables -nL FORWARD
>>>>
>>>> ?
>>>>
>>>> On Jan 7, 2013, at 5:18 PM, Chuck Payne <terrorpup at gmail.com> wrote:
>>>>
>>>>> Guys,
>>>>>
>>>>> Is there a way to only see the rules for the following group iptable rules?
>>>>>
>>>>> Chain OUTPUT (policy ACCEPT)
>>>>> target     prot opt source               destination
>>>>>
>>>>> I know when you do the following command you get everything
>>>>>
>>>>> iptables -L -n
>>>>>
>>>>> But I like to see only the rules for OUTPUT and FORWARD
>>>>>
>>>>> Thanks in advise for any help.
>>>>>
>>>>> --
>>>>> Terror PUP a.k.a
>>>>> Chuck "PUP" Payne
>>>>>
>>>>> (678) 636-9678
>>>>> -----------------------------------------
>>>>> Discover it! Enjoy it! Share it! openSUSE Linux.
>>>>> -----------------------------------------
>>>>> openSUSE -- en.opensuse.org/User:Terrorpup openSUSE
>>>>> Ambassador/openSUSE Member Community Manager -- Southeast Linux
>>>>> Foundation (SELF) skype,twiiter,identica,friendfeed -- terrorpup
>>>>> freenode(irc) --terrorpup/lupinstein Register Linux Userid: 155363
>>>>>
>>>>> Have you tried SUSE Studio? Need to create a Live CD,  an app you
>>>>> want to package and distribute , or create your own linux distro.
>>>>> Give SUSE Studio a try. www.susestudio.com.
>>>>> See you at Southeast Linux Fest, June 8-10, 2012 in Charlotte, NC.
>>>>> www.southeastlinuxfest.org
>>>>> _______________________________________________
>>>>> Ale mailing list
>>>>> Ale at ale.org
>>>>> http://mail.ale.org/mailman/listinfo/ale
>>>>> See JOBS, ANNOUNCE and SCHOOLS lists at
>>>>> http://mail.ale.org/mailman/listinfo
>>>> _______________________________________________
>>>> Ale mailing list
>>>> Ale at ale.org
>>>> http://mail.ale.org/mailman/listinfo/ale
>>>> See JOBS, ANNOUNCE and SCHOOLS lists at
>>>> http://mail.ale.org/mailman/listinfo
>>>
>>>
>>>
>>> --
>>> Terror PUP a.k.a
>>> Chuck "PUP" Payne
>>>
>>> (678) 636-9678
>>> -----------------------------------------
>>> Discover it! Enjoy it! Share it! openSUSE Linux.
>>> -----------------------------------------
>>> openSUSE -- en.opensuse.org/User:Terrorpup openSUSE
>>> Ambassador/openSUSE Member Community Manager -- Southeast Linux
>>> Foundation (SELF) skype,twiiter,identica,friendfeed -- terrorpup
>>> freenode(irc) --terrorpup/lupinstein
>>> Register Linux Userid: 155363
>>>
>>> Have you tried SUSE Studio? Need to create a Live CD,  an app you want
>>> to package and distribute , or create your own linux distro. Give SUSE
>>> Studio a try. www.susestudio.com.
>>> See you at Southeast Linux Fest, June 8-10, 2012 in Charlotte, NC.
>>> www.southeastlinuxfest.org
>>> _______________________________________________
>>> Ale mailing list
>>> Ale at ale.org
>>> http://mail.ale.org/mailman/listinfo/ale
>>> See JOBS, ANNOUNCE and SCHOOLS lists at
>>> http://mail.ale.org/mailman/listinfo
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>>
>>
>>
>> Athena(r), Created for the Cause(tm)
>> Making a Difference in the Fight Against Breast Cancer
>>
>> ---------------------------------
>> CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
>> ----------------------------------
>>
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo



More information about the Ale mailing list