IP stands for "Internet Protocol". It is one of the fundamental protocols that powers the internet. IP is how data is able to be routed to the correct destination - your computer is assigned an IP address, and when you need to get data back, that data gets sent to your IP address.

learn more… | top users | synonyms

39
votes
12answers
27k views

How can I get my external IP address in bash?

I need to find my external IP address from a bash script. At the moment I use this function: myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' } But it depends on ...
36
votes
2answers
4k views

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 ...
31
votes
2answers
2k views

How is it that missing 0s are automatically added in IP addresses? (`ping 10.5` equivalent to `ping 10.0.0.5`)

I accidentally typed ssh 10.0.05 instead of ssh 10.0.0.5 and was very surprised that it worked. I also tried 10.005 and 10.5 and those also expanded automatically to 10.0.0.5. I also tried ...
19
votes
1answer
4k views

Why doesn't Linux use the IANA Ephemeral port range?

According to Wikipedia The Internet Assigned Numbers Authority (IANA) suggests the range 49152 to 65535 for dynamic or private ports. Many Linux kernels use the port range 32768 to 61000. Even ...
16
votes
2answers
1k views

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 ...
15
votes
6answers
10k views

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?
11
votes
12answers
2k views

How to read an IP address backwards?

If we have this string (IP address): 192.168.1.1 How can I derive the (DNS reverse record form) from this string, so it will be shown like 1.1.168.192.in-addr.arpa using a shell script?
10
votes
1answer
586 views

Is it better to set -j REJECT or -j DROP in iptables?

There's an example of iptables rules on archlinux wiki: # Generated by iptables-save v1.4.18 on Sun Mar 17 14:21:12 2013 *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] :TCP - ...
10
votes
2answers
2k views

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.?
9
votes
3answers
1k views

Parsing log files for frequent IP's

So, I hacked this together while undergoing a DDOS attack to pull naughty ips out of my logs. Anyone have any improvements or other suggestions to make it better? Here's the general idea: pull ...
9
votes
1answer
290 views

Send a packet over the network even when its target is the local host

Under Linux if you send a packet to the address of one of its network interfaces, this packet is routed internally, it is never sent over the network. That's the right thing in 99.99% of the cases. ...
9
votes
1answer
3k views

Linux always send ICMP redirect

I have several Debian Squeeze (6.0.6 up to date) used as routers. When a link is down, they send ICMP redirects to local hosts. This is the default behaviour of Debian and several others. So once the ...
8
votes
2answers
1k views

Measuring internet connection quality

I'm having WLAN trouble on my dualbooting win/linux laptop - the connection on linux side has occasional trouble, and seems somewhat slow and chunky. I would try to fix this issue by fiddling with all ...
8
votes
1answer
1k views

Change remote host IP address without losing control (Linux)

How can I change a remote host primary IP address without getting disconnected at all (without being in a "no IP addr" state). The matter is poorly discussed on Internet (according to my research). ...
8
votes
2answers
1k views

How can I disable TCP/IP for an Ethernet adapter?

I have CentOS 6.3 running in a (virtual) machine with two Ethernet adapters. I have eth0 connected to a TCP/IP LAN and eth1 connected to a DSL modem. The system is intended as a dedicated ...
8
votes
2answers
7k views

How can I block a range of IP addresses with an Amazon EC2 instance?

I know a certain range of IP addresses are causing problem with my server, 172.64.*.* what is the best way to block access to my Amazon EC2 instance? Is there a way to do this using security groups or ...
7
votes
3answers
4k views

What's the last number in this ip address?

An IP address like this 223.248.0.0/24 or 223.248.0.0/16 What's the last number mean in the IP address (24 or 16 in the above example)? Is there a simple way to understand how to set the number ...
7
votes
3answers
11k views

How to find out if Ubuntu is using DHCP (Ubuntu 12.04 LTS GUI)

How can I find out if my IP address is DHCP, Fixed or Dynamic? I need to tell my network administrator what the IP address is, that my Virtual Machine is using. I know the numbers, but I don't know ...
7
votes
7answers
2k views

Assigning IP address to environment variable [duplicate]

How can I assign the IP address of eth0 to an environment variable, say $ip, as easily as possible? Update: Distro is Ubuntu Server 12.04 LTS.
7
votes
2answers
156 views

SSH session through OpenVPN cuts off / locks up after a few lines

I have a large number of identical fanless PCs running debian 6 (ARM). Most of these are connected via comcast and work ok. There are some that are connected to 'WiMax' modems and are having ...
7
votes
3answers
14k views

Why are my two virtual machines getting the same IP address?

I have two virtual machines both running on a Linux host (Fedora 16). I set both adapters as attached to NAT. When I boot them up they both have their default gateway set to 10.0.2.2. They also ...
7
votes
4answers
11k views

How to find the IP address of a KVM Virtual Machine, that I can SSH into it?

I have follow this guide (Virtualization With KVM On Ubuntu 11.10) to setup my KVM (Virtual Machines Software) on my Ubuntu 11.10 Server. However, I didn't setup my VM's IP address when creating the ...
6
votes
3answers
465 views

What are the benefits of using several IP addresses on a server?

With ifconfig, I am able to configure multiple IP addresses on a single network interface card. Why would I want to do that and how would I later utilize several addresses, e.g. how does software know ...
6
votes
3answers
3k views

Can't access select https sites on Linux over PPPoE

My internet connection used to be a direct LAN connection to my provider. Back then, everything would load fine on both Windows and Ubuntu (dual boot). However, a while ago they started needing me to ...
6
votes
2answers
3k views

How to build a gateway from my Linux OS

I want to configure my Linux so that it will be used as a network router (gateway). Can anybody give me some hints on this? (links are welcome!)
6
votes
1answer
108 views

bash_completion rule for resolving ip into hostnames

I am trying to create a bash_completion rule for my script rmpxe. This script takes <hostname> as its only argument. It then resolves this hostname into <ip_address> and removes the ...
6
votes
3answers
182 views

How does one capture traffic on virtual interfaces?

I would like to capture traffic on Linux virtual interfaces, for debugging purposes. I have been experimenting with veth, tun and dummy interface types; on all three, I am having trouble getting ...
6
votes
1answer
551 views

Load Balancer Solution with linux

I need a suggestion to realize a proper solution to this problem: As you can see in the image above, I have 2 application servers that need to talk with and external third party provider over the ...
6
votes
3answers
368 views

SpamAssassin Under Linux VPS

I am getting bald with this guys: On a Linux VPS (CentOS), I have setup a mail server (Exim+Dovecot+Clamav+SpamAssassin) but scanning mail for spam using SpamAssassin is proving to be a challenge. I ...
5
votes
3answers
1k views

How can I get the netmask from an IP address?

How do I get a netmask from the IP address? Is there a command to get it?
5
votes
4answers
15k views

How to remove all default gateways

I'm running a custom built linux machine, so not all linux commands are available. I execute network related commands, so I need to set a default gateway right before I run my command, then remove ...
5
votes
3answers
27k views

How can I know if IP Multicast is enabled

I have scripts that run IP multicast tests; however, my scripts are failing on a particular linux machine. I know that I can look at CONFIG_IP_MULTICAST in the kernel configuration file to determine ...
5
votes
2answers
9k views

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 ...
5
votes
4answers
305 views

History of IP addresses that accesed 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 ...
5
votes
3answers
3k views

How to filter IPv4 and IPv6 addresses?

echo "1.1.1.1" | awk '/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/ {print $1}' How can I filter IPv4 addresses in a script, and how can I filter IPv6 addresses. I mean more precisely then this so the oneliner ...
5
votes
2answers
2k views

Routing for multiple uplinks/providers

I have a PC with two internet connections. The first one is an Ethernet interface to connect to my local network and access internet via my router. The second one use a GSM modem to connect with ppp. ...
4
votes
3answers
1k views

Difference between 'ifconfig' and 'ip' commands

I read some articles/tutorials on 'ifconfig' command, most of them included a common statement - "ifconfig is deprecated by ip command" and suggested to learn ip command. But none of them ...
4
votes
4answers
11k views

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 ...
4
votes
6answers
671 views

Find my computer on a LAN network

Let's say that I have a computer plugged in to a local network using a dhcp connection, so it will get a different IP every time. Is there a way to find this computer (so the IP) from a different ...
4
votes
1answer
7k views

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 ...
4
votes
2answers
2k views

Can't ping broadcast

We're running four computers connected to a hub (yes a hub not a switch) on Fedora 13. They were installed using images from a colleague that has recently left us to go back to school, they may have ...
4
votes
1answer
7k views

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 ...
4
votes
5answers
9k views

How to route specific adresses through a tunnel?

There are certain websites/services which I can only access from the subnet on which my server is located (think of the typical intranet scenario). Is there a way to transparently route traffic that ...
4
votes
1answer
50 views

Create map network_iface_name <--> IPv4 address

I'd like to implement a bash script that creates a mapping between the network cards (or interfaces) names in my computer and their IP address (in CIDR format, if possible). The goal is having ...
4
votes
2answers
562 views

What is the difference between `/sbin/ip route` and `/sbin/route`?

Linux comes with two utilities /sbin/route /sbin/ip route What is the difference between the two and what is the rule of thumb to use when you decide which one of the two you should use? I know ...
4
votes
2answers
389 views

is it possible to send the remote connector ip via netcat?

Actually I want to make something like ifconfig.me functionality but only for my internal network. I see it the way smth on server listens some port and send ip of connected remote machine. Seems nc ...
4
votes
2answers
345 views

How can I use one network port for VPN and the other for everything else?

My Linux machine has two network ports with two IP addresses. I want to use one port for my VPN and accounting, and the other port for other usages. How can I tell Linux not to allow any requests from ...
4
votes
2answers
1k views

What tools do I need to intercept and change an incoming packet on a WP2-Personal wifi hub

Which tools should I research into to intercept a plain text packet, edit it and then continue it on it's way. I am using Ubuntu 11.04 and Backtrack 5; my wifi is WPA2-person encrypted. I need to edit ...
4
votes
1answer
938 views

Can't ssh to beaglebone?

After I did: route add default gw 192.168.7.1 I also changed /etc/resolv.conf: nameserver 192.168.7.1 in order to share internet between Ubuntu in VMware. I've got internet working but after a ...
4
votes
2answers
2k views

How to know if a network interface is tap, tun, bridge or physical?

As far as i know, there are 4 main types of network interfaces in linux: tun, tap, bridge and physical. When i'm doing sys admin on machines running KVM, i usually come accross tap, bridge and ...