LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2005, 05:06 PM   #1
LAdProg2005
Member
 
Registered: Oct 2005
Posts: 50

Rep: Reputation: 15
iptable frustration


I need tcp port 139 or 445 to run smb and udp ort 161 for snmp.

I tried editing /etc/sysconfig/iptables:

and adding lines:


-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 161 -j ACCEPT


when i run netstat -ta or netstat -l I don't see either of those two ports open....

does anyone know what I am doing wrong or if there is anything i am forgetting to add

any help be appreciated
thanks
--p
 
Old 11-11-2005, 07:47 PM   #2
Mad Scientist
Member
 
Registered: May 2003
Posts: 167

Rep: Reputation: 30
Look at http://wiki.linuxquestions.org/wiki/Iptables . Get rid of the default firewall script and write your own. It can be very simple.
 
Old 11-11-2005, 08:04 PM   #3
blkcamarozr28
Member
 
Registered: Oct 2005
Location: Honolulu, Hawaii
Distribution: Fedora Core 1-7, CentOS 4/5, Ubuntu/Xubuntu
Posts: 63

Rep: Reputation: 15
Add these two lines to /etc/sysconfig/iptables:

***For Samba***
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --source 192.168.0.0/255.255.255.0 --dport 137:139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --source 192.168.0.0/255.255.255.0 --dport 137:139 -j ACCEPT

***For SNMP***
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 161 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 161 -j ACCEPT

Change the --source 192.168.0.0/255.255.255.0 to your IP network. After that just do a 'service iptables restart' and it should be good to go.



Last edited by blkcamarozr28; 11-11-2005 at 08:06 PM.
 
Old 11-12-2005, 01:50 PM   #4
LAdProg2005
Member
 
Registered: Oct 2005
Posts: 50

Original Poster
Rep: Reputation: 15
for whatever reason it gives me

Applying iptables firewall rules: iptables-restore v1.2.11: Unknown arg `--source'
Error occurred at line: 23
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]

I don't know what is wrong...

another question is when u say

Quote:
--source 192.168.0.0/255.255.255.0
so if my ip is 1.2.3.4 i need to say source 1.2.0.0/... ? or write the full ip....

thanks....
 
Old 11-12-2005, 07:16 PM   #5
blkcamarozr28
Member
 
Registered: Oct 2005
Location: Honolulu, Hawaii
Distribution: Fedora Core 1-7, CentOS 4/5, Ubuntu/Xubuntu
Posts: 63

Rep: Reputation: 15
Quote:
Originally posted by LAdProg2005
[B
so if my ip is 1.2.3.4 i need to say source 1.2.0.0/... ? or write the full ip....
[/B]

It depends on your subnet mask. What is your IP address and Subnet Mask? Also, if you dont want to filter smb via a source address you can just omit '--source 192.168.0.0/255.255.255.0' and it should still work.
 
Old 11-12-2005, 08:05 PM   #6
LAdProg2005
Member
 
Registered: Oct 2005
Posts: 50

Original Poster
Rep: Reputation: 15
For whatever reason when I run xprobe2 -v localhost I get this following error: or I am just not understanding and it is just running fine...

[+] Selected safe Round-Trip Time value is: 0.00034 sec
[-] fingerprint:tcp_hshake Module execution aborted (no open TCP ports known)
[-] fingerprint:smb need either TCP port 139 or 445 to run
[-] fingerprint:snmp: need UDP port 161 open
[+] Primary guess:

xprobe2 -v calif.dyndns.org

[+] Running scan engine
[-] ping:tcp_ping module: no closed/open TCP ports known on calif.dyndns.org. Module test failed
[-] ping:udp_ping module: no closed/open UDP ports known on calif.dyndns.org. Module test failed
[-] No distance calculation. calif.dyndns.org appears to be dead or no ports known
[+] Host: calif.dyndns.org is down (Guess probability: 0%)

the thing is, the host is up and running and it tells me its not...when i run nmap -sT and nmap -sU it gives me tcp and upd ports are running.

When i add the rules in iptables for snmp and samba and restart my iptables it starts ok. but running nmap doesn't show me those ports as open.

Any guesses why this is happening?
 
Old 11-13-2005, 04:33 PM   #7
blkcamarozr28
Member
 
Registered: Oct 2005
Location: Honolulu, Hawaii
Distribution: Fedora Core 1-7, CentOS 4/5, Ubuntu/Xubuntu
Posts: 63

Rep: Reputation: 15
Are you running this server behind a Natted router (Linksys, Netgear, etc..)? If so then you need to port forward on your router to the server. Try to explain your setup better and what you are trying to do. Are you trying to access smb & snmp from the Internet or internal network?
 
Old 11-13-2005, 04:50 PM   #8
LAdProg2005
Member
 
Registered: Oct 2005
Posts: 50

Original Poster
Rep: Reputation: 15
Well, I don't exactly know what firewall school uses but I am running my centos linux server through the university's. So, there is definetly the firewall issue. smb, snmp: are used by xprobe2 for fingerprint if i run it locally it doesn't work or if I try to scan other ip's that are not within the school network.

I am just trying to run xprobe2 successfully and it gives me errors listed above.

I thought if you write the firewall rules in iptables then it should work just fine...but it doesn't seem to..

let me know if u need anymore info.

thanks
--p
 
Old 11-13-2005, 05:43 PM   #9
blkcamarozr28
Member
 
Registered: Oct 2005
Location: Honolulu, Hawaii
Distribution: Fedora Core 1-7, CentOS 4/5, Ubuntu/Xubuntu
Posts: 63

Rep: Reputation: 15
If you think its a local firewall issue on your box then disable iptables 'service iptables stop' and see if xprobe works. If it doesnt then its not a iptables issue.
 
  


Reply



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
Gaim Frustration justaguynsrq Slackware 4 03-10-2005 03:51 AM
Emacs Frustration skibud2 Linux - Software 1 09-17-2003 10:36 PM
SAMBA frustration Riptide Linux - Software 2 12-14-2002 11:14 PM
PPP Frustration cocoanutmaster Linux - Networking 1 11-21-2002 03:46 PM
Telnet Frustration Breezwell Linux - Networking 6 08-16-2001 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:30 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
Open Source Consulting | Domain Registration