LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-11-2005, 08:59 AM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Blog Entries: 7

Rep: Reputation: 32
Unhappy Display open ports "Confused :S"


Hi guys Iam configuring my firewall on my debian router....Ive blocked everything on eth0 except http and ssh.....and Ive not blocked anything on eth1...and the firewall is stateful with masquerading enabled.

When I was trying to test my firewall..I used the following command:
nmap -sS "ipaddress of eth0"
My understanding is that only the ports of ssh and http should be displayed !!!
The following was the output:

The 1656 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
53/tcp open domain
80/tcp open http
111/tcp open rpcbind
113/tcp open auth
199/tcp open smux
615/tcp open unknown

To make things more confusing "at least to me"
I have executed the following command to display open ports on eth1:
nmap -sS "ipaddress of eth1"
And the output was the same as above !!!!

What has happened?? Does nmap only display hte open services regardless of the nic....or what am I doing wrong.....I need a way to know what ports are open on each nic....

Note: the firewall configuration is flawless, I ve already posted it and asked about that.
 
Old 12-11-2005, 11:31 AM   #2
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
netstat -an

WIll show a list of listening ports, established connections etc..


If there is a port that is open, and you don't know what service is listening on it you can use lsof.

lsof -i tcp:615
 
Old 12-12-2005, 09:16 AM   #3
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by ALInux
Hi guys Iam configuring my firewall on my debian router....Ive blocked everything on eth0 except http and ssh.....and Ive not blocked anything on eth1...and the firewall is stateful with masquerading enabled.

Note: the firewall configuration is flawless, I ve already posted it and asked about that.
How did you blocked everything ??
Did you shutdown those services or commented out those services from /etc/services or with iptables you blocked those ports or with some other way ? Please mention..

I let me clear my self with firewalls you actually block the ports & didnt close them.

..amit..
 
Old 12-12-2005, 09:51 AM   #4
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
Aha........actually I only blocked them through my firewall.....!!
 
Old 12-12-2005, 09:57 AM   #5
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by ALInux
Aha........actually I only blocked them through my firewall.....!!
Now you know what to do next with those services..
 
Old 12-12-2005, 10:05 AM   #6
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
You mean I should comment them out ?? Actually, these services are not accesible since Ive blocked the ports right ?
 
Old 12-12-2005, 10:15 AM   #7
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by ALInux
You mean I should comment them out ?? Actually, these services are not accesible since Ive blocked the ports right ?
AFAIK commenting out services in /etc/services doesnt close ports.
You can verify that commenting out ftp service tcp & udp port 21 wont close that service & you would still be able to connect to ftp.
 
Old 12-12-2005, 04:46 PM   #8
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
Now Iam really confused..........All that I want to do is to check for open ports on my PC.......not for running services
 
Old 12-13-2005, 06:09 AM   #9
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by ALInux
Now Iam really confused..........All that I want to do is to check for open ports on my PC.......not for running services
Running services do offer services at port itself. Running services in result provide open ports. So in case you want to shut down ports, you should shutdown those services.

In case you want to see for open ports, Run nmap.
 
  


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
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
"How to check and open ports in Linux" tux4j Linux - Networking 4 09-14-2005 04:56 PM
xset: unable to open display "mycomputer.mynetwork:0.0" nicolaeancuta Linux - Networking 2 07-13-2005 01:39 AM
"Can't open display" error when try to use a program remote heande Linux - Newbie 2 03-11-2005 10:13 AM
unable to open display "24.228.61.72:0.0" while installing oracle remotely cheeku Linux - Newbie 3 08-13-2004 04:08 PM

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

All times are GMT -5. The time now is 03:57 AM.

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