BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 18th, 2005, 06:16 PM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
netstat -an Not showing listening ports

Hello,

5.4-STABLE FreeBSD 5.4-STABLE #0: Fri Jul 29

This is a firewall/web server. I can access it with a web browser and I can ssh to it, but netstat -an doesn't show any listening ports.
Any suggestings on how to show what ports are listening?

PHP Code:
 websrv# netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
udp4       0      0  *.514                  *.*
Active UNIX domain sockets
Address  Type   Recv
-Q Send-Q    Inode     Conn     Refs  Nextref Addr
c3475230 stream      0      0        0 c34751a4        0        0
c34751a4 stream      0      0        0 c3475230        0        0
c3b2a1a4 stream      0      0 c3f59d68        0        0        0 
/tmp/mysql.sock
c3b26118 stream      0      0 c3945738        0        0        0 
/var/run/devd.pipe
c3b2a8c0 dgram       0      0        0 c3b2a2bc        0 c34752bc
c34752bc dgram       0      0        0 c3b2a2bc        0 c3475460
c3475460 dgram       0      0        0 c3b2a2bc        0 c34754ec
c34754ec dgram       0      0        0 c3b2a2bc        0        0
c3b2a2bc dgram       0      0 c3a5a420        0 c3b2a8c0        0 
/var/run/log 

Reply With Quote
  #2  
Old August 19th, 2005, 03:39 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
It does show the listening processes and ports. You just don't have any

Quote:
udp4 0 0 *.514 *.*

This is syslogd listening for connections on all addresses, port 514. But it's UDP, so "listening for a connection" is technically wrong and it doesn't say so.

HTH,
M.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old August 19th, 2005, 07:54 AM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
This is active webserver, but it's not listening on port 80?
I'm also running sshd, (and can connect) but no mention of port 22

Reply With Quote
  #4  
Old August 19th, 2005, 08:04 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
Originally Posted by dfr574
This is active webserver, but it's not listening on port 80?
I'm also running sshd, (and can connect) but no mention of port 22

Are you logged in as root? Maybe you're jail(8)'d.
Is this your own server or rented from an ISP?

M.

Reply With Quote
  #5  
Old August 19th, 2005, 08:16 AM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
Yes it's my server and I'm logged in as root. Although I should have set up a Jail, I didn't.

From another board I was told it might be an error when compiling the new kernel. Somthing about "includes".
I was hoping there was an easier fix I can't afford to take the server down for any extended period of time.

Reply With Quote
  #6  
Old August 19th, 2005, 08:34 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
Originally Posted by dfr574
Yes it's my server and I'm logged in as root. Although I should have set up a Jail, I didn't.

From another board I was told it might be an error when compiling the new kernel. Somthing about "includes".
I was hoping there was an easier fix I can't afford to take the server down for any extended period of time.


Hmm. Maybe after updating, you rebuilt the kernel but not the userland? ("make buildkernel / installkernel" but not "make buildworld / installworld")

M.

Reply With Quote
  #7  
Old August 19th, 2005, 08:56 AM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
So you think there is no way around it, I'm going to have to build and re-install the kernel?

Reply With Quote
  #8  
Old August 19th, 2005, 09:06 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
Originally Posted by dfr574
So you think there is no way around it, I'm going to have to build and re-install the kernel?

I don't know. But I've had similar problems before. "ps" didn't work when I used a newer kernel in an older world. This was because they changed some internal structures then.

I'd say try it. You don't have to drop to single user mode for compiling kernel and world. You can do this with all services running, but you'll seriously degrade performance.

After compiling switch to single user mode for installing kernel & world, and run mergemaster. This shouldn't make more than a few minutes of downtime unless something goes wrong (hint: backup ).

M.

Reply With Quote
  #9  
Old August 19th, 2005, 01:13 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,478 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 12 h 33 m 8 sec
Reputation Power: 852
Wait a second. You don't need to rebuild userland unless you've built a custom kernel first. So, let's start from the beginning here:

* Are you currently running a custom built kernel or not.
* If yes, you will very likely need to rebuild userland tools as well. This is actually part of the procedure, but a surprising amount of people forget to do it. The symptom of this is that the system will boot and run, but certain commands (e.g.) ps, that refer to certain kernel structures suddenly quit working. These userland tools need to be rebuilt to sync with the new kernel.
* If you didn't build a custom kernel, you don't need to rebuild userland tools either. Problem is elsewhere.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #10  
Old August 19th, 2005, 10:38 PM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
Thanks guys for all the advice.

I also posted this on another board and they are pretty much saying the samething.

After going though my notes (I force myself to write each step down... ya ya I know "psycho" ), I notice I never did make buildworld. I can't afford to make any changes now, but when I do; and confirm that was the problem I'll let you know.

Thanks again for all your suggestions.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > netstat -an Not showing listening ports


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |