Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-08-2007, 06:12 AM   #1
LQ Newbie
Registered: Nov 2004
Posts: 28

Rep: Reputation: 15

Hey, I'm very new at iptables and I'm trying to open ports 161 and 162 udp to ip i need need ports 161 and 162 open for only ip know the config file I just ned the paramaters.

Thank you
Old 05-08-2007, 06:18 AM   #2
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
iptables -I INPUT -m udp -p udp --dport 161 -s ! -j DROP
iptables -I INPUT -m udp -p udp --dport 162 -s ! -j DROP

then save them somewhere, for instance /etc/rc.d/rc.firewall or /etc/rc.d/rc.local, so that they are not lost on a reboot

These rules are for systems that have a default ACCEPT policy. If on the other-hand you have a default DROP policy on your system try the following rules instead:

iptables -I INPUT -m udp -p udp --dport 161 -s -j ACCEPT
iptables -I INPUT -m udp -p udp --dport 162 -s -j ACCEPT

Last edited by SlackDaemon; 05-08-2007 at 06:34 AM.
Old 05-08-2007, 06:49 AM   #3
LQ Newbie
Registered: Nov 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Thank you, now what if I just wanted to set a rule so only can talk to this machine and this machine can talk to ( open all ports,like dmz)Problem i'm having is trying to open certain ports,but for some reason i'm missing a few ports that need to be open so for testing i would like to grant access so that the linux machine can talk to on all ports and visa virsa.

thanks again


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Iptables - Couldn't load target `ACCPET':/lib/iptables/ z00t Linux - Security 3 01-26-2004 02:24 AM
IPtables Log Analyzer from brainlego Linux - Software 0 08-11-2003 06:08 AM
iptables book wich one can you pll recomment to be an iptables expert? linuxownt Linux - General 2 06-26-2003 04:38 PM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration