Different ports used by consul - ports

What are the different ports used by consul? What is the purpose of each port? Is there any way to configure consul to run using different ports?

When reading the consul documentation you will find following information.
Ports Used
Consul requires up to 4 different ports to work properly, some on TCP, UDP, or both protocols. Below we document the requirements for each port.
Server RPC (Default 8300). This is used by servers to handle incoming
requests from other agents. TCP only.
Serf LAN (Default 8301). This is used to handle gossip in the LAN.
Required by all agents. TCP and UDP.
Serf WAN (Default 8302). This is used by servers to gossip over the
WAN to other servers. TCP and UDP.
HTTP API (Default 8500). This is used by clients to talk to the HTTP
API. TCP only.
DNS Interface (Default 8600). Used to resolve DNS queries. TCP and
UDP.
You can configure consul services to run on different ports by editing the config file. For example setting the dns interface on port 53 and the HTTP API on port 80. More details on port configuration is here.
{
"ports": {
"dns": 53,
"http": 80
}
}

Minor update to the response from #Brrrr:
https://github.com/hashicorp/consul/blob/master/CHANGELOG.md#080-april-5-2017
All CLI commands that used RPC and the -rpc-addr flag to communicate with Consul have been converted to use the HTTP API and the appropriate flags for it, and the rpc field has been removed from the port and address binding configs.
So now the CLI uses TCP on 8500 like other clients.

Related

How to make IBM Kitura Framework listen on IPv6 port?

I made a web application using IBM Kitura Framework, but the service only listens on IPv4? How to make it listen on both IPv4 and IPv6?
The source code which adds a HTTP server is as follow
Kitura.addHTTPServer(onPort: 8090, with: router)
And I run lsof -i:8090 on my Ubuntu Server, the result is
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ServerNew 1731 root 4u IPv4 24114 0t0 TCP *:8090 (LISTEN)
It shows that the 8090 port only listens on IPv4.
I'm the Business Development Manager for Kitura in IBM. Kitura 2 doesn't yet support IPv6. It's supported in Bluesocket and the underlying frameworks, but has not yet been implemented in the socket.create() api. This is in the backlog and will be coming in the not too distant future.

Broadcast on different subnets

Please if you can help me about my problem. On one side I have server with IP 172.27.13.2 connected to the WAN interface of router 172.27.13.1 ...Then on wireless LAN of my router 192.168.1.1 I have connected a few clients. Now I will write code in C where client are requesting some UDP streams from server, then server broadcasts streams to clients, and if some packets get lost clients must send NACK to server. My questions is:
Because server and clients are on different subnets how can I broadcast from server?
And how the client can send request and NACKs to server because they are in different subnets?
Are these problems can be solved by router configurations or in C code?
Thank you for helping
You cannot broadcast to different subnets. Routers do not usually forward broadcast packets to different subnets, unless you have a very special router that can be configured properly (e.g. Cisco ...). You could however use multicast for such a task. Here's a C example
Also check this: UDP broadcast packets across subnets
NOTE: some includes in the c example are missing, but they are easy to find
As both server & users are in different subnets .As router donot forward broadcast .But we have solution by modifying the router configuration .
If you have cisco router & users are connected on cisco switch ,you can use ip helper address command on switch on vlan .You can allow udp packet on router ACL

Pinging virtual host results in request for timeout

I have apache2 setup with several virtual hosts, but I have it setup so that if you visit the IP address in your browser you get an error 403. When I ping the domain name of one of my virtual hosts, it always just responds with request for timeout, never the latency, why is this?
Perhaps your hosting provider (or your Linux distro) has firewalled ICMP protocol which is necessary for ping to work correctly.
Note that Apache needs only TCP to work properly, and does not need ICMP, which is completely different protocol. In other words, ping may be completely firewalled, and yet, your website will respond correctly.
Some websites actively firewall ICMP, most notable example is microsoft.com.

Communicate to public IP from a local network (WinSock, C)

I'm new to this forum (at least at asking questions), so please be patient. I'm trying to write simple client-server applications to communicate using datagram (UDP) sockets, with C and Windows.
The scenario is very simple, I want to be able to send/receive data from a machine in some local network (behind a GATEWAY/NAT) to some host having public IP. I can send the data, but it seems impossible to receive any data back, because the remote server can't see the client's local IP.
I don't want the user to perform manual port forwarding on the GATEWAY, and I also don't want to use UPnP because of security issues (though it also should be enabled by the user).
I think it is possible because applications like Skype or Browsers can do it, but how ?
Are there some automatically forwarded ports or things like that ? I'm exhausted of searching the web ... PLEASE HELP !
For UDP connections, most home NAT gateways will automatically create a temporary reverse mapping for each outbound packet.
Consider a scenario where your client is running on the internal machine with IP address 192.168.4.5, sending a UDP packet from port 65000 to the external address 64.34.119.12:6789, via a gateway with external IP address 192.0.43.10. When the gateway sees your internal client send a UDP packet from 192.168.4.5:65000 to the external address, it will NAT it to an external address and port, like 192.0.43.10:5500. Your server will see a packet with a source address of 192.0.43.10:5500 and destination address 64.34.119.12:6789. The router also sets up a reverse mapping, so that if it sees a packet arrive on the external interface with a source of 64.34.119.12:6789 and a destination of 192.0.43.10:5500, it will redirect it back to 192.168.4.5:65000. This mapping typically times out after a short while.
This means that in simple cases, all you need to do is:
On the client, use the same port to send to the server and listen for responses;
On the server, respond to the client at the address and port that the client's packet was receieved from, using the same server port that recieved the packet;
Have the client send the initial packet in the conversation;
Don't leave the "connection" idle for more than a few minutes at a time.

How do I open a socket back to port 80 in Silverlight?

Is there a way to open a TCP Socket back to a non-standard Silverlight port such as port 80?
I don't quite understand the restrictions on Silverlight ports.
I would like to open a connection back to the server of origin using any port. I can serve a policy file from port 943 if needed.
Microsoft restricted the ports to a range well outside the "well known ports." This prevents Silverlight from communicating directly to most web-based resources like HTTP, POP, SMTP, etc.
The most common way to get around this is to set up a "proxy" service on your domain. The proxy accepts requests, forwards them through the port on the service you're using, and returns the result.
The allowed port range (after the policy server check) is 4502 through 4532 to my knowledge. Using port 80 would be an HttpWebRequest or the like.

Resources