Make WebSphere listen on IPv4 - websphere

I have a WebSphere application server 8, where I have deployed an enterprise application. Now I want to make that web GUI of that application reachable. So I set up a port (9080), added a web container transport chain, added a virtual host for port 9080, and added that virtual host to my deployed application. However, it is not reachable.
Digging through WebSphere's log, I found this message:
TCPC0001I: TCP Channel TCP_6 is listening on host * (IPv6) port 9080.
So apparently, the channel listens on IPv6, not on IPv4. I verified this with netstat, which indeed shows that the server's process only listens on IPv6. How do I make the channel listen on IPv4 instead? I already tried setting java.net.preferIPv4Stack=true in the server's JVM, but that didn't change anything.
Interestingly, Websphere's console is available via IPv4, but I cannot figure out what part of it is configured differently so that it works, while my setup does not.

On many operating systems IPv6 sockets on the wildcard address (* or ::/0) can accept both IPv4 and IPv6 connections. On for example Mac OS netstat would show such sockets as i.e. tcp46 to show they are dual-stack. Other operating systems, including Linux, just show them as tcp6 even if they also accept IPv4 connections.
So it is probably listening on IPv4 just fine, it's just a confusing way of showing it to the sysadmin.

Related

How do I check whether an open port is TCP or HTTP?

Specifically, I have a Windows server (Windows 7), but the netstat -an command only shows whether ports are TCP or UDP. I thought these were the only kinds of ports, but node.js seems to distinguish between HTTP ports and TCP ports (example at bottom of linked page). I'm currently using node.js in a program that will run on my server, and it opens HTTP ports by default. These appear as TCP ports under netstat -an.
Is there a command line trick for distinguishing whether an open port on this server is HTTP or TCP? I make requests to my Information Technology office about ports that I need on this server, and they need to know whether these ports will be TCP, UDP, etc.
If necessary to use a remote client, I have a Mac that can do the job.
HTTP is an application protocol. Its definition presumes an underlying and reliable transport layer protocol. The transmission Control Protocol is commonly used. However HTTP can use unreliable protocols too (example SSDP).
Now to answer to your question:
netstat -lt : List TCP Listening Ports
netstat -lu : List UDP Listening Ports
If you want to know wether a TCP Port is running HTTP or not, you can check the standard port on HTTP (grep :80). The standard HTTP port is 80. The standard HTTPS port is 443.
All HTTP traffic is transmitted over TCP Ports. I think what may be causing some confusion is that the first node.js example uses the http module and the second example uses the net module.
The http module is built on top of the net module (which handles the TCP layer underlying HTTP).
Refer to: nodejs - net or http module
EDIT:
Only one process can bind to a port. If you're having difficulties connecting, shut down any other applications that may be using the same port, such as your Java Hello World server. Run netstat -an to make sure you don't see the port listed that you're trying to listen on in you node.js TCP server (port 1337) in the example. If nothing is listening on the port, fire up your node.js TCP server and run netstat -an again to make sure it's actually listening on the intended port.
Another suggestion - temporarily turn off the software firewall then use the telnet client on the local server to attempt to connect to the port using the command telnet 127.0.0.1 1337 (replace 1337 with your port) from the command prompt. This will eliminate any network devices such as firewalls between the client (telnet in this case) and the server. If the screen goes blank, you've connected. If you get the message Could not open connection to the host, on port then it's still not listening on the TCP Port. If you can connect locally from Telnet but you cannot connect remotely then there is something blocking your connection.

How to rewrite the TCP destination port during the TCP connection on Windows?

I have a client which is intended to connect to a server. For the client, the remote TCP port number is fixed(i.e. 102). I can NOT change it(while I can change the remote IP address). However, the TCP Port number the server is listening on is fixed as well(i.e. 1024) and I can NOT change it too. These two port numbers are different. I want to make the client connect to the server smoothly.
At the first, I had a idea that I setup a proxy listening on localhost:102 and the client connect to 127.0.0.1:102. Then this proxy redirect these TCP traffic to the real address RemoteServerIP:1024. But I found on my windows, there was already a process which is listening on 0.0.0.0:102 and I can NOT change its listening port. So this idea can NOT work.
Thank you very much.
if you cannot do it on the same windows machine running client, why not try to do it on another (linux maybe) machine?

Does a JVM listen on an IPv6 debugging port?

I cannot connect to a remote JVM on a host that only has an IPv6 interface.
What parameter should be passed to the JVM to enable listening on the IPv6 interface?
Unfortunately you can't. The Java VM being debugged only listens on IPv4. This is a known issue and is in Oracle's documentation:
The current implementation on the target VM side only supports IPv4, but this could change in a future release so that both IPv4 and IPv6 are supported.
One way to work around this would be to have a program (such as xinetd or rinetd for *nix-based servers) installed on the host, listening on IPv6, and forwarding connections to the IPv4 port that the JVM is listening on.

Cannot reach socket server on AWS EC2

I am trying to run a socket server on an Amazon Web Services EC2 instance. The socket is able to run just fine on it's own, and telnetting locally on the instance can connect, but trying to telnet to the socket from the outside is failing. I have gone into the security groups to ensure the ports I am using are open for both TCP and UDP (though the socket server has been configured for TCP). Is there something else I am missing?
The server might be listening on the loopback interface or ipv6 by default. You can check that by running netstat --listen -p which will show you which program listens on which address/port. How to make the program listen on the external ipv4 interface depends on the program/programming language.

Creating a local server visible through firewalls

I have a local server written in C++ listening to inbound TCP connects using plain socket ::accept() and UDP recvfrom(). I have two problems with this that I wish to solve:
Can I programatically make Windows let me open the accept socket without it automatically being blocked by the Windows (software) firewall?
Are there any ports I can use that will allow my packets to pass through both Windows firewall and external firewall? Port 80 is often taken by things like Skype, but are there others? Will most external firewalls typically by default allow incoming UDP and TCP connects on port 80?
Thanks!
In general, network routers need Port Forwardng enabled for the listening port, and firewalls need the listening port opened. If you are using a uPNP-enabled firewall/router, then you can dynamically set up those settings programmmably via the uPNP API. But more times than not, uPNP is either disabled or unavailable, requiring manual settings by the firewll/router admin.

Resources