Questions tagged [ipv4]

Use the ipv4 tag ONLY if the nature of your question specifically involves IPv4 addresses or networking -- often in contrast to IPv6. Most networking currently involves IPv4 addresses, so you should NOT include this tag with every networking question.

IPv4 (Internet Protocol version 4) is the fourth version in the development of the Internet Protocol. IPv4 is a connectionless protocol for use on packet-switched networks. It works on a best effort delivery model, in that it does not guarantee delivery, nor does it assure proper sequencing or avoidance of duplicate delivery.

Addressing

IPv4 uses 32-bit (four-byte) addresses, which limits the address space to 4294967296 addresses. IPv4 reserves special address blocks for private networks (~18 million addresses) and multicast addresses (~270 million addresses). These addresses are written in the dot-decimal notation, which consists of four octets of the address expressed individually in decimal and separated by periods.

The system known as classful networking defined five classes, Class A, B, C, D, and E. The Classes A, B, and C had different bit lengths for the new network identification. The rest of an address was used as previously to identify a host within a network, which meant that each network class had a different capacity to address hosts. Class D was allocated for multicast addressing and Class E was reserved for future applications.

Based on the IETF standard RFC 1517 published in 1993, this system of classes was officially replaced with Classless Inter-Domain Routing (CIDR), which expressed the number of bits (from the most significant) as, for instance, /24, and the class-based scheme was dubbed classful, by contrast. CIDR was designed to permit repartitioning of any address space so that smaller or larger blocks of addresses could be allocated to users.

Private Networks

Three ranges of address are reserved for use in private networks. These ranges are not routable outside of private networks, and private machines cannot directly communicate with public networks. They can, however, do so through network address translation.

The following are the three ranges reserved for private networks (RFC 1918):

10.0.0.0–10.255.255.255

172.16.0.0–172.31.255.255

192.168.0.0–192.168.255.255

Space Exhaustion

Several market forces accelerated IPv4 address exhaustion:

  • Rapidly growing number of Internet users
  • Always-on devices — ADSL modems, cable modems
  • Mobile devices

To mitigate the IPv4 address exhaustion it was developed Network address translation (NAT). This technology allows a private network to use one public IP address.

The accepted and standard long term solution is to use Internet Protocol Version 6. The address size was increased in IPv6 to 128 bits, providing a vastly increased address space that also allows improved route aggregation across the Internet and offers large subnetwork allocations of a minimum of 264 host addresses to end-users. Migration to IPv6 is in progress but completion is expected to take considerable time.

110 questions
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
30
votes
2 answers

netstat — why are IPv4 daemons listening to ports listed only in -A inet6?

I have a computer with: Linux superhost 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux It runs Apache on port 80 on all interfaces, and it does not show up in netstat -planA inet, however it unexpectedly can be found in netstat -planA…
Mischa Arefiev
  • 868
  • 1
  • 7
  • 15
19
votes
3 answers

Two interfaces, two addresses, two gateways?

I have a system that has two network interfaces with different IP adresses, both of which are in the public address range (albeit via NAT in the case of the first one) and both of which have different gateways. (Long story, it's for testing…
Shadur
  • 30,641
  • 11
  • 58
  • 69
18
votes
8 answers

Can I prevent a default route being added when bringing up an interface?

I have a system with two NICs on it. This machine, and a few accompanying devices will be moved and attached to different LANs or sometimes it'll be using dial-up. eth0: - 10.x.x.x address space - no internet gateway - only a few…
Tango
  • 353
  • 1
  • 2
  • 8
14
votes
2 answers

curl request to IPv6 localhost gets stuck

A docker container of mine exposes a HTTP interface on port 8500, which is mapped to host port 8500. It is not IPv6 enabled. This still means, I should be able to access it at localhost:8500. IPv6 is preferred, so I end up with a request to…
mknecht
  • 241
  • 2
  • 4
12
votes
10 answers

Bash: Extract one of the four sections of an IPv4 address

We can use the syntax ${var##pattern} and ${var%%pattern} to extract the last and first section of an IPv4 address: IP=109.96.77.15 echo IP: $IP echo 'Extract the first section using ${var%%pattern}: ' ${IP%%.*} echo 'Extract the last section using…
sci9
  • 517
  • 2
  • 7
  • 19
9
votes
2 answers

Static IPv4 & IPv6 configuration on CentOS 6.2

I try to configure static IPv4 & IPv6 configuration on CentOS 6.2. The configuration below works perfectly : # ifconfig eth0 x.x.x.x/29 # route add defalt gw x.x.x.y # ip addr add dev eth0 XXXX:C810:3001:D00::3/56 # ip -6 route add default…
Yohann
  • 240
  • 1
  • 2
  • 7
9
votes
8 answers

Installing vsftpd - 500 OOPS: could not bind listening IPv4 socket?

I have to set up a FTP server on my machine. I have installed vsftpd using the command: sudo apt-get install vsftpd I then edited the configuration file vsftpd.conf in the location /etc. The file contains: #Set the server to run in standalone…
Alper Turan
  • 193
  • 1
  • 1
  • 4
8
votes
1 answer

wget uses ipv6 address and takes too long to complete

On a server wget-1.16 takes 8 minutes to complete: $ wget http://http.debian.net/debian/dists/stable/Release -O - --2017-06-12 23:44:40-- http://http.debian.net/debian/dists/stable/Release [4693/5569] Resolving http.debian.net…
x-yuri
  • 3,223
  • 10
  • 39
  • 62
7
votes
1 answer

Detect other machine's address in link local?

I have two machines connected in link local IPv4 over a CAT6 cable. Is there a way from host1 that I can determine host2's IPv4 address? I'm on an Debian-derivative running kernel 3.2.0-34-generic.
Naftuli Kay
  • 38,686
  • 85
  • 220
  • 311
7
votes
1 answer

How can I get the ipv4 address from `ip link` like I used to see with ifconfig?

When I run ip to get the ip address, I'm getting $ ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: wlp3s0:…
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
7
votes
6 answers

Validating IP addresses (IPv4 and IPv6)

Quite simply I'd like to verify that a string represents a valid IP address in a Bash script. I think like many others I've fallen into the pitfall of trying to do this with a regular expression; while this works well enough for IPv4, IPv6 is more…
Haravikk
  • 1,021
  • 2
  • 13
  • 19
6
votes
3 answers

SSH login via IPv6 successfull while using IPv4 to the same host yields "Permission denied"

I'm currently stumped by a strange problem… I have a dual stack host to which I want to SSH. If I connect via IPv6 everything works like expected datenwolf@foo ~/ > ssh -6 bar.example.com Password: datenwolf@bar ~/ > However when doing the same…
datenwolf
  • 319
  • 1
  • 2
  • 13
6
votes
1 answer

How do i check if DHCP is enabled?

I have a VM running Debian 9 and the latest version of VirtualBox. I have VirtualBox configured to use the bridged adapter and it was working fine yesterday. But when I came and got on it this morning... I am unable to access the network from it or…
Bryan Pruett
  • 61
  • 1
  • 1
  • 4
5
votes
1 answer

How do packets flow through the kernel

When it comes to packet filtering/management I never actually know what is going on inside the kernel. There are so many different tools that act on the packets, either from userspace (modifying kernel-space subsystems) or directly on…
AFP_555
  • 251
  • 2
  • 11
1
2 3 4 5 6 7 8