Hot answers tagged

47 votes

How to set the preferred network interface in Linux

Here's the complete answer, in case it helps others: To make packets with destinations 192.168.10.* use eth0, and all other packets use eth1: 1) View your current routing table ip route list One ...
  • 641
21 votes
Accepted

AWS flagged my subnet as invalid although it looks to be within the VPC CIDR block

Nope, 10.8.0.0/24 doesn't fall into 10.0.0.0/16. AWS is correct, sorry :) In your 10.0.0.0/16 you can create subnets between 10.0.0.0/24 to 10.0.255.0/24, e.g. 10.0.8.0/24 would work. Let's say we'...
  • 24.2k
19 votes
Accepted

How to configure iptables so an unwanted port is not reported as filtered

Don't use DROP, that's easily identified as "filtered" if you know the box is up. Instead, you may use the following to send a RST. (as if there is a service listening, but it doesn't accept ...
  • 1,126
14 votes

What is the maximum port number in Linux?

Although 1-65535 are legit TCP ports and it is true that 1-1023 are for well known port services. You may run into random issues with your own services if they are started after an ephemeral port is ...
14 votes
Accepted

Can I add a static route to a VPN network if the default gateway IP is dynamic? (Windows 7)

I've found out the answer myself: You don't actually need to specify the default gateway - you can use the catch-all of 0.0.0.0 and then specify the interface number instead (the docs do not make this ...
  • 654
13 votes

How is the MTU is 65535 in UDP but ethernet does not allow frame size more than 1500 bytes

UDP doesn't know anything about MTU. UDP packets can have any size from 8 to 65535 bytes. The protocol layers below UDP either can send a packet of a specific size or will reject to send that packet ...
  • 859
13 votes
Accepted

When to use routable vs non-routable IP addresses

Those ranges you list are described in this RFC 1918 - Address Allocation for Private Internets The title gives away their use case: "... for Private Intranets". All IP Address ranges are ...
  • 14.3k
12 votes

Which is the default TCP connect timeout in Windows?

Usually "connect timeout" refers to the timeout for creating the initial connection to a host. In many systems (Windows 7 included), this value is configured using separate settings from timeouts for ...
11 votes

When to use routable vs non-routable IP addresses

I guess I'm going to be the contrarian on this one. IMO, too many people make too much of a fuss trying to correct people when they talk about class-full ip addressing. The RFC 1918 reserved addresses ...
  • 109k
10 votes

How does IPv4 Subnetting Work?

I’ll pose and answer a few related questions along the way: Why do you see 255.255.255.0 so often? Why 192.168.0.1? Why 127.0.0.1? Why such weird numbers — 255, 192, 168, 127? 8+8+8+8-bit dotted ...
10 votes

How to configure iptables so an unwanted port is not reported as filtered

-A INPUT -p tcp -m tcp --dport 995 -j REJECT --reject-with tcp-reset should be doing what you want (reply with RST).
  • 97.9k
9 votes
Accepted

Is it useless to reply the received messages (on TCP) on application layer to tell the sender the messages have been successfully received?

It is not redundant. TCP only cares about delivery between two systems, not between two applications. The ACK is sent once data are successfully received. The payload of the packets is then put into ...
7 votes

TIME_WAIT consumes file descriptors?

The file descriptor is used by application to read/write from the socket. Thus if the application call close(), the file descriptor is immediately released. On the other hand, if the application call ...
  • 386
7 votes

TCP timeout for established connections in Windows

By default an established TCP connection does not time out (but may do so because of hardware restrictions). An application can use the TCP keepalive mechanism to check for broken connections. In ...
6 votes

How does IPv4 Subnetting Work?

While the above is correct (sorry, TL;DR), calculating subnets still causes many network administrators a lot of grief. There actually is a very easy way to do subnet calculation, you can do most of ...
6 votes
Accepted

How does stunnel redirect traffic?

It doesn't; the application needs to be configured to point to the tunnel endpoint. In the case you're referring to, the client would need to be reconfigured to point to the local stunnel listener, ...
5 votes

Why is wireshark capturing packets not destined to my host?

Wireshark, being a network sniffer, put both the interface firmware (if present) and driver into promiscuous mode, meaning that it instruct the network stack to capure any packets arriving at your ...
  • 45.1k
5 votes

Unix socket vs TCP/IP host:port

Pros of Unix domain sockets. Access can be managed through the Unix user permission system either by setting the permissions on the socket itself or by the server reading the usename of the ...
  • 4,096
5 votes

IP on different subnet mask

So your gateway IP is 192.168.1.120. What is its subnet mask? If it is 255.255.255.0, in no way you can use a 192.168.2.x IP and hope that it works. Client IP and network gateway must be on the ...
  • 45.1k
5 votes

what are the implications of running a FQDN as internal AD domain and point A-record for website to different host?

This won't work. Domain Controllers register A records for the AD DS Domain that they are authoritative for. This is why domain naming is so important. So if your DCs are 10.1.1.1 and 10.1.1.2 and ...
  • 100k
4 votes

Is it possible to configure Nginx to send TCP keepalive?

You have 2 options: use stock so_keepalive nginx option use nginx-tcp-keepalive module directives listen ... so_keepalive=on listen directive with so_keepalive option is server level. See http://...
  • 171
4 votes

Huge amount of TIME_WAIT connections says netstat

tcp_fin_timeout does NOT control TIME_WAIT delay. You can see this by using ss or netstat with -o to see the countdown timers: cat /proc/sys/net/ipv4/tcp_fin_timeout 3 # See countdown timer for all ...
  • 5,560
4 votes
Accepted

TCP sequence number randomization

I have nothing against Overmind's answer, which is definitely a good summary of why sequence number randomisation was invented. But I'm not sure it answers the question as asked, so I will try to do ...
  • 79k
4 votes

What is the best IP subnet to avoid subnet collisions?

You can use fdc8:6837:6e34:2b0c::/64 to avoid collisions. It is highly unlikely that anybody else is using that exact prefix. That prefix was generated according to RFC 4193. The way RFC 4193 works ...
  • 30.1k
4 votes
Accepted

Two subnets on one LAN

Question 1 Can computers on the testing LAN use the 192.168.1.254 GW & DNS? Not the gateway, since they're in seperate networks. DNS can be used if the DNS server is reachable. Question 2 What ...
  • 1,837
4 votes
Accepted

Linux: tracking the source of netstat -s "failed connection attempts"

Let's try to answer the question in another way (hard way). Read the source of the kernel to see, what there is only one place, where this metric increments - tcp_done function. As we can see in the ...
3 votes
Accepted

Why I cannot access EC2 instance public IP from inside of instance itself?

I don't see an issue pinging my own public ip from inside the instance. make sure you add a rule in the security groups associated with the instance.
3 votes
Accepted

Can a port be in the listen state and be closed?

The service is listening on the loopback adapter only. If you use the -n option to lsof (or netstat or ss), you'll see that the listening address is 127.0.0.1:27017. This means that connections made ...
  • 4,380
3 votes

How are IP addresses actually assigned?

This is a very old question, but I had many of the same questions in figuring out how the Internet works. Like the other answers, the networking books give an overview of BGP and DNS but still left me ...
3 votes

How does IPv4 Subnetting Work?

I also feel that there should atleast be a mention of NATs, because they are used so commonly in modern networks in place of Subnets, because of IPv4 address exhaustion,among other things. (Also, when ...

Only top scored, non community-wiki answers of a minimum length are eligible