Questions tagged [ip]

Questions about the IP protocol and IP addresses. For Linux ip utility related questions, use iproute tag instead.

IP (Internet Protocol) is the network protocol used over the Internet to route packets from one machine to another. Machines on the Internet are identified by an IP address. There are two versions of IP: the older and ubiquitous , and the newer .

Use this tag for questions about the IP protocol and its support on unix systems. Related tags include:

  • , , for protocols on top of IP
  • , for protocols below IP
  • for machine names (IP identifies machines by numeric addresses)
  • for the Linux iproute2 utility suite, which includes the ip command.
1144 questions
701
votes
8 answers

Finding the PID of the process using a specific port?

I am installing hadoop on my Ubuntu system. When I start it, it reports that port 9000 is busy. I used: netstat -nlp|grep 9000 to see if such a port exists and I got this: tcp 0 0 127.0.0.1:9000 0.0.0.0:* …
wuchang
  • 7,457
  • 5
  • 16
  • 16
342
votes
27 answers

How can I get my external IP address in a shell script?

I need to find my external IP address from a shell script. At the moment I use this function: myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' } But it relies on perl-libwww, perl-html-format, and perl-html-tree being…
Eugene Yarmash
  • 14,675
  • 14
  • 50
  • 57
110
votes
25 answers

How to get my own IP address and save it to a variable in a shell script?

How can I get my own IP address and save it to a variable in a shell script?
The Student
  • 3,439
  • 9
  • 30
  • 34
105
votes
3 answers

How can I create a virtual ethernet interface on a machine without a physical adapter?

I have a Dell XPS 13 ultrabook which has a wifi nic, but no physical ethernet nic (wlan0, but no eth0). I need to create a virtual adapter for using Vagrant with NFS, but am finding that the typical ifup eth0:1... fails with ignoring unknown…
STW
  • 2,191
  • 4
  • 19
  • 22
102
votes
7 answers

List ports a process PID is listening on (preferably using iproute2 tools)?

I'm looking to list all ports a PID is currently listening on. How would you recommend I get this kind of data about a process?
ThorSummoner
  • 4,312
  • 6
  • 30
  • 47
100
votes
2 answers

What is kernel ip forwarding?

I have seen on many blogs, using this command to enable IP forwarding while using many network security/sniffing tools on linux echo 1 > /proc/sys/net/ipv4/ip_forward Can anyone explain me in layman terms, what essentially does this command do?…
Madhur Ahuja
  • 1,501
  • 3
  • 12
  • 14
89
votes
3 answers

show gateway IP address when performing ifconfig command

Currently, when using the ifconfig command, the following IP addresses are shown: own IP, broadcast and mask. Is there a way to show the related gateway IP address as well (on the same screen with all the others, not by using 'route' command)?
amigal
  • 1,915
  • 1
  • 14
  • 9
74
votes
3 answers

Using ip addr instead of ifconfig reports "RTNETLINK answers: File exists" on Debian

I have a Debian system working as a wireless router with eth0 and wlan0. Now I added an additional network manually on eth1 with ifconfig: alix:~# ifconfig eth1 192.168.0.2 netmask 255.255.255.0 alix:~# netstat -rn Kernel IP routing…
ceving
  • 3,461
  • 5
  • 21
  • 30
73
votes
9 answers

History of IP addresses that accessed a server via ssh

It has come to my attention that a server of mine has been hacked and infected with a known Chinese botnet. It was a prototype/testing virtual machine with its own static IP(US address) so no harm was caused(just took me a while to figure it…
Dominique
  • 5,155
  • 8
  • 26
  • 29
70
votes
4 answers

How do I know what service is running on a particular port in linux?

I am trying to run weblogic server on my linux machine and I am getting the following error : ERROR: transport error 202: bind failed: Address already in use ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error…
Geek
  • 6,548
  • 15
  • 46
  • 70
70
votes
2 answers

How does SSH connection survive a network restart?

From a Linux SSH shell, type /etc/init.d/network restart to restart the network service. I expect my SSH connection to die since the network service goes down. But it doesn't. Very cool. But how does Linux achieve this? How does it keep my SSH…
Serge Wautier
  • 908
  • 1
  • 6
  • 9
58
votes
3 answers

Can TCP provide more than 65535 ports?

Is it possible to setup a Linux system so that it provides more than 65,535 ports? The intent would be to have more than 65k daemons listening on a given system. Clearly there are ports being used so this is not possible for those reasons, so…
slm
  • 363,520
  • 117
  • 767
  • 871
57
votes
5 answers

IP to Country console command

Is there a console command that takes an IP address as an input and shows its geographical information like city, country, ISP, etc.?
BuZain
  • 673
  • 1
  • 5
  • 7
49
votes
3 answers

Is there an easy way to programmatically extract IP address?

Is there an easy way to programmatically extract IP address, without tedious parsing of ifconfig? I would not mind simple command output processing using sed to do it but not processing multiline files from /etc some place. What I am trying to do…
amphibient
  • 12,222
  • 18
  • 62
  • 87
47
votes
4 answers

Why assign MAC and IP addresses on Bridge interface

Say I create a bridge interface on linux (br0) and add to it some interfaces (eth0, tap0, etc.). My understanding is that this interface act like a virtual switch with all its interfaces/ports that I add to it. What is the meaning of assigning a MAC…
Gradient
  • 3,579
  • 10
  • 31
  • 37
1
2 3
76 77