Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Fronted bind ip Port issu

Shulou Source: shulou.com Published: 2022-06-01 08:47:50 11月26日 Update

.vip failed to take effect

Example: maybe it's the configuration habit. Some people don't make mistakes all their lives here, while others are different.

I mainly didn't pay much attention to the difference between 0.0.0.0 and 192.168.0.1. I know that the former represents

Socket snooping is generated on port 80 of all interfaces on the machine, and the latter only produces the 192.168.0.1 80 socket. Please note my description.

The former is an interface and the latter does not specify an interface. If I have eth0 eth0:1, then the former will generate two sockets (what is a socket? Ip: Port-> socket)

The latter will only generate 192.168.0.1 IP 80 this socket is not aimed at which interface (as long as the local network card interface has the 192.168.0.1 this socket). This is the background of this problem.

Once when I was doing the HA of haproxy, it was all configured, but it didn't work, but telnet vip 80 didn't produce a result, which means there was no socket, ah, no listening on port 80.

After looking for it for a long time, I finally re-looked at the configuration file of haproxy and found that my fronted was written like this. Bind 192.168.0.222 bind 80 see here you should understand?

The problem is that if I write this, there is no socket when the vip is bound to the eth0 port. If this is changed to 0.0.0.0, vip:80 and 192.168.0.222 will be generated.

Two sockets. The 0. 0. 0. 0. 0. 0 IP 80 will generate sockets for all Nic interfaces. This is the key to solving the problem. Until this problem is solved.

Tags: Sockets problems interfaces ports that is configuration two time Nic native monitor representative function key writing just place file result background Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Redmi MySQL Huawei