Service fabric and IPv4 - azure-service-fabric

After running DevClusterSetup.ps1, fabric gateway by default listens on IpV6 only even if the host doesn't even have an ipv6 IP address.
Since in my lap we only have ipv4 I wonder how to bind it to ipv4 ?
PS C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup> netstat -ano | select-string 19000
TCP 127.0.0.1:2880 127.0.0.1:19000 ESTABLISHED 7848
TCP 127.0.0.1:19000 0.0.0.0:0 LISTENING 5764
TCP 127.0.0.1:19000 127.0.0.1:2880 ESTABLISHED 5764
TCP [::1]:19000 [::]:0 LISTENING 5764
PS C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup> get-process -id 5764
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
155 61 5436 13056 52 0.09 5764 FabricGateway
PS C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup> telnet 192.168.88.153 19000
Connecting To 192.168.88.153...Could not open connection to the host, on port 19000: Connect failed
As you can see FabricGateway is the one listening on port 19000 but I can't telnet to it with the IPv4 address.
When you have an IPv4 only environment somewhere, this is going to cause an interesting issue.
How can we configure this ?

For security reasons, a DEV cluster by default listens on loopback addresses, 127.0.0.0:19000 for IPv4 and [::1]:19000 for IPv6, to disallow connections from outside the machine. telnet 192.168.88.153 19000 does not work as it tries to connect to non-loopback address 192.168.88.153 of your machine, there is no listener on 192.168.88.153:19000 by default. This is not about IPv4 vs IPv6. If you want to connect with 192.168.88.153, you will need to replace localhost with either 192.168.88.153 or FQDN of your machine in your cluster manifest file. Be aware that this makes your endpoint visible from outside your machine.
<NodeList>
<Node NodeTypeRef="NodeType01" IsSeedNode="true" IPAddressOrFQDN="localhost" NodeName="Node1" FaultDomain="fd:/RACK1" UpgradeDomain="MYUD1" />

Related

nmap: what does "state = closed" means

I am trying nmap command on two remote hosts public ip address
~ % nmap (remote host1 - public ip)
Starting Nmap 7.91 ( https://nmap.org ) at 2021-03-23 20:08 EDT
Nmap scan report for openrg (remote host1 - public ip)
Host is up (0.0093s latency).
Not shown: 994 closed ports
PORT STATE SERVICE
443/tcp open https
515/tcp open printer
631/tcp open ipp
4567/tcp open tram
8080/tcp open http-proxy
8443/tcp open https-alt
~ % nmap (remote host2 - public ip)
Starting Nmap 7.91 ( https://nmap.org ) at 2021-03-23 20:09 EDT
Nmap scan report for (remote host2 - public ip)
Host is up (0.023s latency).
Not shown: 996 filtered ports
PORT STATE SERVICE
80/tcp open http
445/tcp closed microsoft-ds
8000/tcp open http-alt
8080/tcp closed http-proxy
I am looking for the port 8080
in host1 it shows STATE = open and in host2 it shows STATE = closed
what does http-proxy means here.
nmap tries to tell the type of service (process running) that is listening the port based on well-known services. That means that the service it is running on 8080 is "probably" an http-proxy server. This recognition is based on a database that associates the port number with this service, so it does not guarantee it is an http-proxy indeed, but guess it.
See Nmap Service and Version Detection.
The closed state means that the port is accessible from nmap probe packets but there is no application listening on it. See Nmap Port Scanning Basics

Keycloak port 39008 and port scan

I did a port scan using nmap on my machine running Keycloak and was surprised to find that port 39008 was open. According to nmap:
39008/tcp open unknown
Using the following two commands I found that it is keycloak:
netstat -tulpn | grep 39008
tcp 0 0 0.0.0.0:39008 0.0.0.0:* LISTEN 17270/java
ps -Af | grep 17270
me 17270 17223 0 Dec22 ? 00:13:05 java ...-Djboss.home.dir=/.../keycloak-2.4.0.Final
I cannot find any reference to this port in the config or the docs.
What is this port used for?

How to get Sendmail to listen on 110 POP3

I'm trying to configure Sendmail to listen on on 110 POP3 on a ec2 server. I need it for a newsletter app so that it can check for bounces. When I try to telnet in on port 110 I get a connection error.
root:/# telnet sub.domain.com 110
Trying 5?.??.?.?0...
telnet: Unable to connect to remote host: Connection refused
root:/# telnet sub.domain.com 25
Trying 5?.??.?.?0...
Connected to sub.domain.com.
Escape character is '^]'.
220 ip-172-31-54-114.ec2.internal ESMTP Sendmail 8.14.4/8.14.4/Debian-4.1ubuntu1; Wed, 30 Nov 2016 10:24:50 GMT; (No UCE/UBE) logging access from: [5?.??.?.?0](FORGED)-ec2-5?-??-?-?0.compute-1.amazonaws.com [5?.??.?.?0] (may be forged)
^]
telnet> quit
Connection closed.
When I lsof on port 25 I can see that it's working but not on 110.
root:/# lsof -n -i :25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sendmail- 4279 root 4u IPv4 2349285 0t0 TCP *:smtp (LISTEN)
root:/# lsof -n -i :110
root:/#
Do I need to edit the sendmail.mc file, previously I commented out the below lines so that smtp would listen to all IPs.
dnl DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
I've searched the sendmail.cf & sendmail.mc for any references to pop3/port110 configuration but can't see anything.
Sendmail MTA acts like SMTP server. You need separate program/server to service POP3 protocol e.g. dovecot IMAP/POP server.
Sendmail-FAQ-4.19 : How do I configure sendmail for POP/IMAP/...?

SSH Tunnelling - Remote Debugging

I can ssh into the server say abc.xyz on port 22 but i can't remote debug it in Eclipse. Here is the additional info :
Server startup arguments -
-Xdebug -Xrunjdwp:transport=dt_socket,address=1234,server=y,suspend=n
Confirmation from logs -
Listening for transport dt_socket at address: 1234
When I telnet on my local system -
local-machine% telnet abc-xyz 1234
Trying xx.xx.xx.xx...
telnet: connect to address xx.xx.xx.xx: Connection timed out
telnet: Unable to connect to remote host: Connection timed out
When I telnet on the server(abc.xyz) -
abc-xyz% telnet localhost 1234
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
I've tried setting up tunnel via -
ssh -L 1234:localhost:1234 user#abc-xyz
ssh -L 1234:127.0.0.1:1234 user#abc-xyz
I'm attaching debugger in Eclipse with this config -
Connection type - Standard (Socket attach)
Host - localhost
Port - 1234
Can't get Eclipse to attach to 1234.
After setting up SSH Tunnel, if i manually try to connect to the port, i get this response -
local-machine% telnet localhost 1234
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
and I see an entry in catalina.out as:
channel 4: open failed: connect failed: Connection refused
Any help would be appreciated.
EDIT - 1:
I ran
abc-xyz% ~#
and got the following output:
The following connections are open:
#2 client-session (t4 r0 i0/0 o0/0 fd 7/8 cc -1)
#3 direct-tcpip: listening port 1234 for localhost port 1234, connect from 127.0.0.1 port 23456 (t4 r1 i0/0 o0/0 fd 10/10 cc -1)
I think ssh tunneling is working, it's just the way i'm connecting with Eclipse which is going wrong here.
I just had to increase timeout. (Can be done via Window->Preferences->Java->Debugging. Set it to some appropriate value.)

Not clear why my /etc/hosts look like this

I am bit confuse , my hosts file look like :
> 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain
> localhost6 localhost6.localdomain6
> 127.0.0.1 autoreply.panel.mywebsite.com
> 127.0.0.1 myhostname
> 127.0.0.1 panel.mywebsite.com
why doesn't show the machine Ip address ?? Even so the website is working and the website is accessible from the web.
Anyone can please explain ?? Thank you
Think of /etc/hosts as a dns system override. You can specify hostnames by IP addresses in this file.
For example you could do the following:
echo "127.0.0.1 google.com" >> /etc/hosts
And proceed to ping google.com:
[jclark#jclark530 ~]$ ping -c1 google.com
PING google.com (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.028 ms
Your attached server IP address(es) will show by running /sbin/ifconfig