Firewall opened on port, Test-NetConnection fails - windows

Strange behavior, i working on configuring Kafka broker on my home server PC and trying to connect from another computer over wifi. The firewall port is opened on 9092 using following command
netsh advfirewall firewall add rule name="TCP Port 9092" dir=in
action=allow protocol=TCP localport=9092
However when i try to use Test-NetConnection to test the port connectivity it fails. I cannot connect to any port that is configured as open in windows firewall settings not sure why. I have disabled ipv6 on client and server
PS C:\Users\ram> Test-NetConnection 10.58.35.113 -Port 9092 -Verbose
WARNING: TCP connect to (10.58.35.113 : 9092) failed
VERBOSE: 113.35.58.10.in-addr.arpa
VERBOSE: 113.35.58.10.in-addr.arpa
VERBOSE: 113.35.58.10.in-addr.arpa
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = QueryIsolationType,'className'
= MSFT_NetAddressFilter,'namespaceName' = root\standardcimv2'.
VERBOSE: Operation 'Invoke CimMethod' complete.
ComputerName : 10.58.35.113
RemoteAddress : 10.58.35.113
RemotePort : 9092
InterfaceAlias : Wi-Fi
SourceAddress : 10.58.35.134
PingSucceeded : True
PingReplyDetails (RTT) : 1 ms
TcpTestSucceeded : False
Update
Kafka broker is running with in windows linux subsystem, hence this odd behavior. When i install the kafka broker on window Test-Netconnection successful

Related

Unable to start CIMSession

I've been breaking my head over this error. When I try to start a new CIMSession, it says it cannot find the computer. Ive verified that both computers are on the same network and that they both can talk to each other. I can ping both PCs from each other and i can access the shared folders as well. I can ping using both IP and NetBIOS name. I have added both PCs to the trusted hosts on Group Policy and have allowed it on the firewall. What am i missing or what am i doing wrong?
PS C:\Windows\system32> $session=New-CimSession -ComputerName DESKTOP-FJMTUOQ
New-CimSession : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a
firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to
remote computers within the same local subnet.
At line:1 char:10
+ $session=New-CimSession -ComputerName DESKTOP-FJMTUOQ
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ConnectionError: (:) [New-CimSession], CimException
+ FullyQualifiedErrorId : HRESULT 0x80338126,Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCommand
+ PSComputerName : DESKTOP-FJMTUOQ
Error
EDIT
When running Test-NetConnection -ComputerName DESKTOP-FJMTUOQ -CommonTCPPort WINRM, I get the following results
PS C:\Windows\system32> Test-NetConnection -ComputerName DESKTOP-FJMTUOQ -CommonTCPPort WINRM
WARNING: TCP connect to DESKTOP-FJMTUOQ:5985 failed
ComputerName : DESKTOP-FJMTUOQ
RemoteAddress : 10.0.2.15
RemotePort : 5985
InterfaceAlias : Ethernet
SourceAddress : 10.0.2.254
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False
EDIT - Same test but backwards (from DESKTOP-FJMTUOQ to WIN-R9HLL0ILD3)
PS C:\Users\freyes.FRANK> Test-NetConnection -ComputerName WIN-R9HLL0ILD37 -CommonTCPPort WINRM ComputerName : WIN-R9HLL0ILD37
RemoteAddress : 10.0.2.254
RemotePort : 5985
InterfaceAlias : Ethernet
SourceAddress : 10.0.2.15
TcpTestSucceeded : True

can't connect to postgres on windows10

I am setting up project on my windows PC and I have a problem with postgres.
Project is set on docker.
when I run docker-compose up I receive error
: *** Failed to connect to database dev; trying to create database
/usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:224:in `initialize': PG::ConnectionBad: could not connect to server: Connection refused (Sequel::DatabaseConnectionError)
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I don't know what to do. I have already installed microsoft easy-fix for TCP-IP, shut down windows firewall, changed all connection in pg_hba.conf to trust. Nothing helps. I don't have any antivirus software installed.
nmap report:
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0027s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 995 closed ports
PORT STATE SERVICE
135/tcp open msrpc
445/tcp open microsoft-ds
2068/tcp open avocentkvm
2179/tcp open vmrdp
5432/tcp open postgresql
edit:
I run psql -h localhost and received
psql: CATASTROPHIC: role "Kamil" does not exist
Kamil is my PC name.
edit2:
is it possible that docker doesn't have access to postgres on localhost?
problem solved
I had to set environment var to DB_HOST=docker.for.win.localhost

debugging remote websphere application from eclipse

I've configured my server to run with the following flags:
Server--> Server Types --> WebSphere application servers --> Additional Properties --> Debugging Service:
JVM Debug Arguments= -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
JVM Port= 8888
I configured eclipse debug configuration with the server ip (verified that ip is reachable with the ping command) and port
To be sure i increased the debugger timeout as well .
I've got: Failed to connect to remote VM. Connection refused.
Connection refused: connect
so i did a port scan on the server with (nmap xxx.xxx.xxx.xxx -p 8888) and the port seems:
PORT STATE SERVICE
8888/tcp closed sun-answerbook
moreover looking at the section Server--> Server Types --> WebSphere application servers --> Communications-->Ports of WebSphere admin consolle
i don't see the port 8888 in the list.
what do i need to do?
open the port on the machine? (how?)
add the port in the list of the above mentioned section?
other?
###### EDITED ########
ADDITIONAL CHECKS
netstat -na | grep 8888 --->no listening port/doesn't show me nothing
----------------------------------------------------------------------------
[root#dmgr ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
----------------------------------------------------------------------------
C:\Users\alex>nmap 192.168.115.235 -p 8888
Starting Nmap 7.60 ( https://nmap.org ) at 2018-02-23 10:58 ora solare Europa occidentale
Nmap scan report for xxxx.xxxxxxxxxxxx.com (192.168.115.235)
Host is up (0.0018s latency).
PORT STATE SERVICE
7777/tcp closed cbt
Nmap done: 1 IP address (1 host up) scanned in 4.59 seconds
so, no listening port on 8888, no iptables rules that deny the connection, how to investigate further?
You are almost there :-)
On the Debugging Service page where you set the port and arguments, there is a checkbox - Enable service at server startup - ensure that it is checked.
If not, check, and restart the server.
After that you should see the debugging port open. You can check it for example via netstat -an.
If the port is open and you still cannot connect then it is probably the firewall issue.
Here some more details about setting the debug - Starting the application server in debug mode

Telnet / Security Groups

I'm in the middle of installing and configuring an XMPP server, using ejabberd on Windows server 2012, running on an EC2 box.
I have opened port 5222 within windows firewall, and added to the security group for the EC2 instance
Custom TCP Rule
TCP
5222
0.0.0.0/0
ejabberd_c2s
Custom TCP Rule
TCP
5222
::/0
ejabberd_c2s
My XMPP logins are not working, and so I've turned to telnet to try and debug - it sees that port 5222 is reporting as closed:
PS C:\WINDOWS\system32> telnet hostname.com 5222
Connecting To hostname.com...Could not open connection to the host, on port 5222: Connect failed
Any guidance or steps towards debugging would be appreciated!
The issue here was in ejabberd's default configuration of "::" as an IP to listen, which forced it to listen only to IPv6.
By updating the ejabbed config to
port: 5222
ip: "0.0.0.0"
module: ejabberd_c2s
I was able to connect via telnet, and able to access the server using XMPP.

Jmeter perfMon plugin ERROR: java.net.ConnectException: Connection timed out: connect

I am using PerfMon listener to get graphs for memory, cpu etc. For this I have obeyed the following steps:
At server:
The agent i have run on the server and cmd says
INFO 2016-03-30 15:12:04.206 [kg.apc.p] (): Binding UDP to 4444
INFO 2016-03-30 15:12:04.269 [kg.apc.p] (): Binding TCP to 4444
INFO 2016-03-30 15:12:04.269 [kg.apc.p] (): JP#GC Agent v2.2.0 started..
I have set java path till bin in the environment variable.
I also tried saving startAgent.bat with complete path of the java.exe file
At client/jmeter plan:
I have unpacked the JmeterPlugins standard jar and now I do see the listener jp#gc perfmon collection metric
In jmeter.properties I have also updated the server ip with port in remote host section
Under jp#gc - PerfMon Metrics Collector, I have added row with host ip its port 4444
Action:
Now if I run a small test and expected graph for CPU/memory etc, I just see
"ERROR: java.net.ConnectException: Connection timed out: connect"
I doubted firewall could be the issue so I set it off but that also did not help.
Any help will be much appreciated!
Your setup at client and server side is correct.
But you have not mentioned opening of port # 4444. So it is most probably the cause of issue.
In order to make it work, Your port#4444 should be visible to JMeter client machine.
To verify if it is visible or not. you can use..
http://www.canyouseeme.org/
http://portchecker.co/
If it is not visible from Client machine, then you will need to open it. Visit these links to learn how to open port.
http://www.wikihow.com/Open-Ports
or you may use following from command line
netsh advfirewall firewall add rule name="Open Port" dir=in action=allow protocol=TCP localport=4444
netsh advfirewall firewall add rule name="Open Port" dir=out action=allow protocol=TCP localport=4444
Try checking if you can connect to port 4444 on the machine where Server Agent is running using telnet command like:
telnet YOUR_HOST 4444
and sending test command like
You should receive Yep response. If it is not the case - server side performance monitoring won't work and you will need to establish connectivity between Metrics Collector and Server agent (usually it is enough to open TCP and/or UDP ports 4444 in firewall)
See How to Monitor Your Server Health & Performance During a JMeter Load Test article for more information

Resources