Questions tagged [ipv4]

IPv4 is the "old style" IP protocol currently used in most circumstances.

IPv4 is the protocol which has been in use since the early 1980s, described in IETF publication RFC791. It gets gradually replaced with nowadays as the IPv4 addresses become exhausted.

More information at http://en.wikipedia.org/wiki/Ipv4

1045 questions
8
votes
1 answer

As IPV6 needs 128 bits(16 bytes) then why in postgres CIDR datatype has storage as 24 byte(8.1) and 19byte(9.1)?

i am working with ipv4 and ipv6 to store in postgres db. as ipv4 needs 32 bits(4byte) and ipv6 needs 128(16byte) bits.then why in postgres CIDR and INET datatype has the storage as 12 byte and 24 bytes respectively for IPV4 and IPV6(8.1). with…
Asha Koshti
  • 2,763
  • 4
  • 22
  • 30
8
votes
3 answers

How to compare IP address range in C#?

If I have an IP address range (CIDR notation) and I need to know if some arbitrary IP address is within that range -- both presented as strings -- what is the easiest way to do this with C#? Examples: IPv4 Range: 192.168.168.100/24, IP to check:…
ahmd0
  • 16,633
  • 33
  • 137
  • 233
7
votes
3 answers

How do I use BitShifting to convert an int-based IP address back to a string?

The following code to converts an IP to an int in a very fast way: static int ipToInt(int first, int second, int third, int fourth) { return (first << 24) | (second << 16) | (third << 8) | (fourth); } source Question How do I use…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
7
votes
3 answers

Why we have to change application layer in IPv6 if this is a layered architecture?

If TCP/IP is a proper layered architecture why do we need to change all the applications in the application layer in order to change a bottom layer protocol IP from version 4 to version 6?
deltaaruna
  • 528
  • 6
  • 24
7
votes
2 answers

php cidr prefix to netmask

I'm looking to convert a cidr prefix (e.g. /28) to a netmask (e.g. 255.255.255.240) and have not located a function for this, does one exist in php? If not, how would I go about doing this?
phpnoobipv4
  • 71
  • 1
  • 1
  • 2
7
votes
1 answer

Is there a java api that will identify the ipv6 address fd00:: as local/private?

I'm looking for a java api that will correctly identify if a given ip address is private or local. This code seems to work for most ipv4/ipv6 addresses: boolean isLocalIp = InetAddress.getByName(ipAddr).isSiteLocalAddress() || …
CraigF
  • 81
  • 5
7
votes
2 answers

What does "IPv4 addresses in the same AS" mean?

I'm in the process of moving a website from HostGator to Amazon EC2. Front end and back end are both moved. I added a Hosted Zone in Amazon Route 53 and updated my nameservers in HostGator. Unfortunately, the site won't load. I ran a check with…
paulmiller3000
  • 436
  • 8
  • 24
7
votes
1 answer

IPv6 scope ID vs IPv4

Recently I was working with the Berkeley socket API for IPv6, and noticed that IPv6 addresses (sockaddr_in6) have a field called sin6_scope_id, which was not part of IPv4 addresses. After searching around a bit, I’ve learned that scope_id is meant…
Tamás Zahola
  • 9,271
  • 4
  • 34
  • 46
7
votes
2 answers

how to convert ipv6 address to ipv4 address in nodejs expressjs?

Request object of NODEJS provides this method req.connection.remoteAddres to get the client's IP Address, but it gives the address in IPV6 format,how do I convert it into IPV4 format which is more readable ?
7
votes
1 answer

Spring boot application listens over IPv6 without -Djava.net.preferIPv4Stack=true and -Djava.net.preferIPv4Addresses parameters

My question about Spring boot jar. When running jar on production machine as: java -jar xyz.jar It does not respond to my request. Because it is listening on ipv6. But when I run application as java -jar xyz.jar -Djava.net.preferIPv4Stack=true…
Ali Dogan
  • 71
  • 1
  • 4
7
votes
3 answers

ansible_default_ipv4.address undefined in docker ubuntu

I am trying to run a simple ansible operation which should update a line in /etc/hosts: - hosts: localhost become: true vars: master_host: "ansible-master" tasks: - hostname: name="{{master_host}}" - name: Add master host to…
nettie
  • 628
  • 1
  • 11
  • 23
7
votes
1 answer

Getting IPv4 and IPv6 programatically of Android Device with non deprecated methods, both when on Wifi and when on Carier's network

I came across a few discussion about getting IPv4 and IPv6 addresses programmatically on Android. The problem with these other questions and answers is: Those question/answers are fairly old by now thus often deprecated. I am looking for a way to…
lehrer
  • 171
  • 1
  • 5
7
votes
1 answer

Listen on TCP4 not TCP6

I am using https://github.com/gin-gonic/gin to write an http service But when I deploy it, it keeps deploying on tcp6(according to netstat) r := gin.Default() //none of these are working , It keeps being listed on…
user914584
  • 571
  • 8
  • 15
7
votes
2 answers

IPv6: Why are IPv4-mapped addresses a security risk?

The OpenBSD manual states: For security reasons, OpenBSD does not route IPv4 traffic to an AF_INET6 socket, and does not support IPv4 mapped addresses, where IPv4 traffic is seen as if it comes from an IPv6 address like ::ffff:10.1.1.1. Where both…
7
votes
2 answers

How show IPv4 only with REMOTE_ADDR in PHP?

I have a question with variable : $_SERVER['REMOTE_ADDR']. I wish he recovers ONLY IP addresses in IPv4 format . It extracted me a few times in IPv6 format . How to do?
Aymeric98
  • 137
  • 2
  • 2
  • 9