Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-11-2005, 08:59 AM
|
#1
|
Member
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Rep:
|
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.
|
|
|
12-11-2005, 11:31 AM
|
#2
|
Member
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310
Rep:
|
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
|
|
|
12-12-2005, 09:16 AM
|
#3
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
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..
|
|
|
12-12-2005, 09:51 AM
|
#4
|
Member
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Original Poster
Rep:
|
Aha........actually I only blocked them through my firewall.....!!
|
|
|
12-12-2005, 09:57 AM
|
#5
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
Quote:
Originally Posted by ALInux
Aha........actually I only blocked them through my firewall.....!!
|
Now you know what to do next with those services.. 
|
|
|
12-12-2005, 10:05 AM
|
#6
|
Member
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Original Poster
Rep:
|
You mean I should comment them out ?? Actually, these services are not accesible since Ive blocked the ports right ?
|
|
|
12-12-2005, 10:15 AM
|
#7
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
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.
|
|
|
12-12-2005, 04:46 PM
|
#8
|
Member
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Original Poster
Rep:
|
Now Iam really confused..........All that I want to do is to check for open ports on my PC.......not for running services
|
|
|
12-13-2005, 06:09 AM
|
#9
|
Member
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 07:48 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|