LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-30-2016, 09:42 AM   #1
rallan
LQ Newbie
 
Registered: Dec 2016
Posts: 2

Rep: Reputation: Disabled
Change netstat local address


This must be very simple but I can't find an answer

I need to change the results of 'netstat -ta' local address to a network ip e.g.

$netstat -ta

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
..
tcp 0 0 localhost:6543 *:* LISTEN
..

*to*

$ netstat -ta

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
..
tcp 0 0 192.168.1.214:6543 *:* LISTEN
..

This needs to be done so that port 6543 is not blocked to outside traffic.

Any suggestions? Thanks in advance.
 
Old 12-30-2016, 10:01 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,513

Rep: Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572Reputation: 1572
Code:
man netstat
And you'll find....

Code:
   --numeric , -n
       Show  numerical  addresses  instead  of trying to determine symbolic host, port or user
       names.

   --numeric-hosts
       shows numerical host addresses but does not affect  the  resolution  of  port  or  user
       names.

   --numeric-ports
       shows  numerical port numbers but does not affect the resolution of host or user names.

   --numeric-users
       shows numerical user IDs but does not affect the resolution of host or port names.
 
Old 12-30-2016, 10:22 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I suspect the OP wants to change where it is LISTENing not just see it in numeric format.

For that he'd need to run with the "-p" flag to identify the PID then look at that process to see how it gets configured to change where it LISTENs. Probably would also have to open the port in the firewall (iptables, firewalld or other) to be able to connect from other systems once he has it LISTENing on the correct interface.

I'd written more detail but LQ logged me out rather than posting it because of some odd timeout happening since yesterday.
 
Old 12-30-2016, 12:01 PM   #4
rallan
LQ Newbie
 
Registered: Dec 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
The -p option enabled me to find out the application (i.e. mythtv) so now all I have to do is find out where it is being set! Thanks.

However if this proves difficult to discover, is there a hack which can override the initial port allocation from 'localhost' to the desired ip address?
 
Old 12-30-2016, 12:15 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I don't do MythTV myself but many do. If you do a search for "MythTV 6543" you'll find that is a default port apparently.

This post talks about a config file for MythTV so may offer some guidance:
https://ubuntuforums.org/showthread.php?t=2337481
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
change destination ip address/port of packet using libipq to be of local process fzansari Linux - Networking 0 03-05-2013 02:45 AM
netstat output - Both local ip address:port and foreign ip address:port are same!!! ashim_rana Linux - Networking 3 04-22-2012 11:06 PM
CentOS 3.5 Enterprise Server -- I need to change my Local Static IP address. kexpert Red Hat 12 11-08-2009 05:33 AM
NETSTAT utility - what does Local Address mean? PostEnlite Linux - Networking 2 09-29-2006 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:41 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