LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


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

Rep: Reputation: 15
iptables


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

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

Rep: Reputation: 30
iptables -I INPUT -m udp -p udp --dport 161 -s ! 172.17.1.2/32 -j DROP
iptables -I INPUT -m udp -p udp --dport 162 -s ! 172.17.1.2/32 -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 172.17.1.2/32 -j ACCEPT
iptables -I INPUT -m udp -p udp --dport 162 -s 172.17.1.2/32 -j ACCEPT

Last edited by SlackDaemon; 05-08-2007 at 07:34 AM.
 
Old 05-08-2007, 07:49 AM   #3
spivy66
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 172.17.1.2 can talk to this machine and this machine can talk to 172.17.1.2 ( 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 172.17.1.2 on all ports and visa virsa.

thanks again
 
  


Reply


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 09:20 PM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 03:24 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 07:08 AM
iptables book wich one can you pll recomment to be an iptables expert? linuxownt Linux - General 2 06-26-2003 05: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 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:10 PM.

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