Changing SNMP port number


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Changing SNMP port number
# 1  
Old 11-20-2002
Changing SNMP port number

hi,

i am using Sun Solaris 8 (Sparc). Currently there is a SNMP agent running on port 161.

How should I change it to port 8001?

which file to modify and restart is necessary?

pls teach me the information.

thanks
# 2  
Old 11-20-2002
You would modify /etc/services. And yes a restart would be needed almost certainly. I'm not familiar with the program that you're using, but I'm never seen a program yet that monitors /etc/services for changes and then dynamically switches ports.
# 3  
Old 11-20-2002
Thanks for the answer, but it does not seem right.

I checked the /etc/services file and confirmed there is no entry for snmp or port 161.

I am pretty sure that my workstation already has a SNMP agent running on port 161. But I am jsut not able to find where the port number is specified and how to change it.

Please give your advice .

Thanks
# 4  
Old 11-20-2002
/etc/services is not used to configure ports.

/etc/services is not (generally) used to change ports. It is simply (most often) a mapping between port number and friendly names... so when you do 'netstat' for example, there will be a name for the port versus a number.

There are very few (if any) programs (that I know of) that open and read /etc/services to determine what port to bind to. To change a listening port it would be necessary to either have a configuration file entry (like HTTP/Apache httpd.conf) or a command line switch that tells the forked process to listen on a certain (bind and listen) port.

It is a (very common) misconception that changing an entry in /etc/services changes how a program binds to a port/socket. There is also the misconception that commenting out these entries blocks ports (wrong!). Commenting out the entries simply insures that the name will not come up when you do a netstat, etc.
# 5  
Old 11-21-2002
Solaris 8 System Administrator Collection Says.....

from ... Solaris 8 System Administrator Collection >> Solstice Enterprise Agents 1.0 User Guide >> 3. SNMP-Based Master/Subagent

http://docs.sun.com/db/doc/806-2905/6jc3duo34?a=view

Code:
snmpdx [-h] [-p port_number] [-r filename]

[-a filename] [-c dirname] [-i filename] [-o filename] [-y]

[-m GROUP|SPLIT] [-d debug_level]

BTW: Found this info with these keywords on Google: "snmpd.conf" "Solaris 8"

Seems our lives as a moderators is going to the net and doing Google searches for posters Smilie
# 6  
Old 11-21-2002
Re: /etc/services is not used to configure ports.

Quote:
Originally posted by Neo
/etc/services is not (generally) used to change ports.
Well, I must say that that with the versions of unix that I am familiar with, /etc/services does indeed control which ports a program will use.

To verify that this is still true I signed in to a Solaris 8 and a HP-UX 11 system. I did a "telnet localhost" and verified that I got a telnet session. Then I changed /etc/services so that the telnet entry said 21/tcp rather than 23/tcp. Then I repeated the "telnet localhost" test. In both cases I was now talking to a ftp server.

Yes, the telnet program does offer the user a way to override the default port on the command line. But even there, an /etc/services search is performed if the port is non-numeric. That's why "telnet localhost 25" and "telnet localhost smtp" both work.

Doesn't your unix system behave the same way?
# 7  
Old 11-21-2002
Perderabo,

You are right!!! telnet reads /etc/services and starts-up based on the /etc/services mapping ALSO I can stop telnet from starting up based on commenting out /etc/services (running linux).

I stand corrected about telnet.

It does NOT work for Apache web server, however.

I think telnet is an exception (and there must be a few others) .... because generally I can't control ports with /etc/services.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

2. Red Hat

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies

3. IP Networking

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies

4. Cybersecurity

Port Address Changing....

Is there a software solution to stop intruders from changing my port addresses? Causes IPmap to crash. Platform is OS/X Leopard. (1 Reply)
Discussion started by: aleatory
1 Replies

5. Shell Programming and Scripting

changing number in bash (number is in form of string)

I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as name1:name2:name3:1 when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 Replies

6. Programming

Changing source port number of a TCP client packet

Hi all, I need to change the source port number of an outgoing TCP packet. First I have to bind the socket to a particular port(suppose 9001) but when I send the TCP packet I want to change the source port number lets say to 9002 still letting the socket to be bound to the same old port (9001).... (0 Replies)
Discussion started by: anuragrai134
0 Replies

7. UNIX for Dummies Questions & Answers

port number

hi all i want to connect a system, how can i know the port number of a system. (2 Replies)
Discussion started by: tukuna82
2 Replies

8. UNIX for Dummies Questions & Answers

Need to know port number

Hi expert, I wanted to know in which port my apache is running in solaris box thanks Shaan (1 Reply)
Discussion started by: shaan_dmp
1 Replies

9. Red Hat

changing snmp strings

If I change my SNMP strings from the default PUBLIC to something else. Does this take effect right away or do i have to restart snmpd or HUP it or...something...? this is RHEL 3 AS (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

10. Cybersecurity

get number of a port

Hello every one. I work in a LAN with many application server. Each one use a different port. What command permit to obtain the number of these port. thanks (2 Replies)
Discussion started by: hoang
2 Replies
Login or Register to Ask a Question