How to bind tomcat 7 to ipv6 - tomcat7

I am trying to bind apache-tomcat-7.0.77 to my local link ipv6 address. Please note that I am working on windows 10 pro.
I have done below -
[1] At first I simply initiallized the server with start command and tried to hit the tomcat's manager page using my local link address ([ipv6]:8080/manager/html), but it didnt work.
[2] As a workaround,
[2.a] I have added a configuration in C:\Windows\System32\drivers\etc\hosts file for a new hostname and my local link address like this -- [my local link address] rahul
[2.b] Updated the tomcat's server.xml, with a new address attribute ---
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" address="<my local link address>"/>
[2.c] Now when I hit the url - http://rahul:8080/manager/html, I am able to reach to manager page. But it is still not working with url -- http://[ipv6 add]:8080/manager/html
Also command -
`netstat -an | find "8080"`
giving me output --->
`TCP [<my local link ipv6 add>]:8080 [::]:0`
That means tomcat is actually listening to my local link ipv6 address.
This approach is working but the only problem with this approach is that I have to mention the address in server.xml
Please help me by suggesting the way through which I can bind the tomcat 7 to ipv6 on windows machine without specifying address attribute in server.xml

A lot of times devices with multiple "up" interfaces will have issues connecting to Link-Local addresses since the prefix is the same across all interfaces. For instance, if you have WiFi turned on as well as a wired link, your OS probably doesn't know which interface to send the Link-Local traffic out. I came across this with nMap a while back and the solution was to add "%eth0" at the end when scanning a Link-Local host. The reason I bring this up (even though you didn't ask about nMap) is just to let you know how this works.
Replace %eth0 with the actual interface ID of one of your interfaces and the Link-Local address with your own:
http://[fe80::bad:c0de%eth0]:8080/manager/html
Internet Explorer needs to escape the value so preface it with 25 so it looks like this:
http://[fe80::bad:c0de%257]:8080/manager/html
I just found this https://msdn.microsoft.com/en-us/library/windows/desktop/ms740593(v=vs.85).aspx which shows exactly what to do with Windows.
Edit: I just re-read what you asked and noticed that this is about binding Tomcat specifically, not just accessing a page over Link-Local.
From what I can gather, so long as the server entry has address="::" then it should bind to all IPv4 and all IPv6. With this, your netstat -na | find "8080" should have the Tomcat server listening on all IP addresses (including Link-Local). Then, use what I suggested above to browse to the Link-Local address to test it.

Related

Connectivity from WSL2 to host by using actual IP

Has anyone used WSL2 and connected to the host machine using its actual IP instead of through the WSL2 Network Adapter IP?
My situation is this:
My ip is 192.168.1.2
I start a webserver on my actual machine, it binds to 127.0.0.1, and 192.168.1.2
I want do connect to the webserver from within a docker container under WSL2.
If I ping/telnet/curl to 192.168.1.2 the call simply fails from a timeout, this happens both from my docker container as well as straight from within ubuntu under WSL2
I have verified that I can ping my router at 192.168.1.1 from within my docker container.
I cannot access 192.168.1.2 from within my WSL2 shell outside of docker.
I cannot use 127.0.0.1 as a replacement, as the end goal is to run a setup of docker inside WSL2, that calls the webserver on my machine (i.e. I want to start up 4 services and a database through docker, and then actively develop and debug a 5 service on my actual machine).
I've tried disabling the firewall completely to no avail.
Does anyone have an idea of what it could be?
Or if I'm even supposed to be able to access 192.168.1.2 from within WSL2.
A few different ways (and things you might have to do) to make this work. You may have some of this in place already:
First, as mentioned in the comments, the best name to use (in most cases) from WSL2 when accessing a service running Windows is the mDNS format $(hostname).local (or the equivalent from whatever language you are using). This can be hardcoded as simply the Windows "Computer Name" + (concatenated with) .local.
Next, remember that the first time you try to access a network service on a port, Windows Defender Firewall will ask you for permission to create a rule. By default, this rule only applies to Private network profiles. As a result, a corresponding Block rule is created for the port on any Public network profile. I honestly just discovered this when trying this out. I don't think I knew that a corresponding Block was generated by that GUI dialog.
Since WSL's network is (oddly) considered Public, you'll need to delete that Block rule if it exists.
You'll then also need to open an Allow rule for the port from WSL. Something like:
New-NetFirewallRule -DisplayName "WSL Testing" -InterfaceAlias "vEthernet (WSL)" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
This will open the port on both Public and Private networks, but only on the WSL virtual interface. It will still be blocked from other machines on the network (assuming that's what you want).
Now for the bind address, you have several options:
If you really do want to bind only to the WSL virtual network, then you'll need to either obtain (or parse somehow) the correct address, since it will after each reboot (or wsl --shutdown). You can see the correct address with ipconfig in PowerShell, and look for:
Ethernet adapter vEthernet (WSL):
Connection-specific DNS Suffix . :
...
IPv4 Address. . . . . . . . . . . : 172.25.208.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
...
In this case, the bind address would be 172.25.208.1.
Alternatively, I don't believe there's much of a reason not to just bind to 0.0.0.0 (all interfaces), since the firewall is going to block connections from other networks (assuming you specified the -InterfaceAlias "vEthernet (WSL)").
However, from the comments, you also mention:
192.168.1.2 is the IP of my WiFi connection. I know the IP isn't system wide, but the webserver binds to that IP, so I need to be able to access it
If you really can't change the bind address to something else, then you won't be able to access it directly from WSL2. However, it's still possible to use port forwarding to get the packets to the right interface, if that's the case.
The easiest way to do this is to install/enable the Windows OpenSSH server, and then use something like:
ssh -L 80:localhost:80 $(hostname).local
That will make localhost:80 in WSL2 connect to the Windows service on port 80.
If you need the server name to match some virtual host name (SNI), then you can add the hostname to your Windows host file (which is mapped into WSL2 by default) as a pointer to localhost.

Bash-Ubuntu 18.04-ROS-Melodic: Ping to IP address does not return anything

I have a Velodyne Puck 16 sensor that I have been trying to connect to ROS Melodic for the past few days. My OS is Ubuntu 18.04. I was able to find out the address of the lidar using WireShark, as it is possible to see below:
So the IP is: 10.0.1.201
After very very carefully following the installation procedure in the official documentation everything I was trying was unsuccessful.
So I decided to apply a simple ping procedure to the address of the lidar:
ping 10.0.1.201 it does not return any package of information despite it seems connected.
The problem I have is that, despite I know the IP address of my Velodyne 16 using Wireshark, the lidar does not answer to a simple test as the ping of the id.
Steps I followed:
1 Configure your computer’s IP
Below the connection procedure: I created a velodyne_interface connection, see below:
Existing Connection
velodyne_interface
2 Connecting your computer to LIDAR through terminal
emanuele#pc:~$ sudo ifconfig enp109s0 192.168.3.100
Add a static route to the LIDAR's IP address.
emanuele#pc:~$ sudo route add 10.0.1.201 enp109s0
3 Checking the configurations [Problem is here]
To check the connection open your web browser and access the following sensor’s network address.
The problem is that I never get to see the webpage showing the lidar data. Basically I never get to see the page below provided in the official documentation:
What is happening? Why is that happening?
There is probably some problems with the routing. You can try debugging the routing issues, some googling will probably help there. Some commands which might help pinpoint the problem tracepath -n 10.0.1.201 and ip route list.
The easiest solution to your problem would be to just configure the "velodyne_interface" you created to the same subnet as your velodyne lidar. So in the "velodyne_interface" set your ip to 10.0.1.20 for example. Connect to the "velodyne_interface" connection, verify that you have the ip you set by typing ip a or ifconfig in some terminal and you should be able to access the Velodyne web interface from 10.0.1.201. From there you can configure the velodyne sensor networking to the settings you like.

SonarQube on windows - can only view locally

I have a windows server 2016 machine which I have Jenkins running on. I wanted to install SonarQube. So have downloaded v7.1
I have managed to start sonarqube on the machine and can view the webserver at http://localhost:9000
I tried to view the page on a different machine using the IP address and port 9000, but this doesn't connect. Looking in the sonar.properties file I can see
Binding IP address. For servers with more than one IP address, this property specifies which
address will be used for listening on the specified ports.
By default, ports will be used on all IP addresses associated with the server. sonar.web.host=http://xx.xxx.xxxx.xxx
If I use http:// then sonarqube starts, but I can't see sonarqube from any other machine, if I don't use http:// (so just the ip) then it won't start with a bind error.
Has anyone experience of setting this up on windows?
Turns out it was something a lot simpler, the machine is being run on azure and there was no port 9000 endpoint

how to access xampp server from internet using dynamic ip address

I have installed xampp server on my windows 7.
I am connecting internet using HUAWEI Dongle.
I don't have any static IP address.i Want to access my php file from internet example I have connected to internet now I have dynamic IP address like 100.101.73.240 if some one enter 100.101.73.240/home.php in his browser address bar then my home.php page should open in his browser.
What should I do for this give me step by step guide.
Local Ip can't work over the internet. It's your intranet network. If you have dynamic internet IP, then you simply configure the Dynamic DNS service. Which you can configure your Internet Router with the following settings (provided by the Dynamic DNS service providers).
dyn.com
noip.com
dynu.com
many more.
Thanks
If you want to share IP with someone from your local area network:
Go to cmd, run ipconfig command, and find your local IP, which should be like 192.168.xxx.yyy. You can easily share it with no worries it will change each time you reset your network.
If it's someone from external network:
You have no power to share your external IP if you have dynamic one, it will change too often, but still it should work for a short connection sessions. To obtain a stable address you would have to register a domain

Stored Endpoint IP Address after Network Configure Changes in RMI

I've got a RMI server running on a mac. Once I changed the server IP and restart the Application and clients, then clients keep connect to the old ip address with right bind and lookup address. I really have no idea what went wrong because the program is working on another linux server just with different port.
What the remote object clients got is Proxy[MinervaInterface,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[192.168.0.104:51815](remote),objID:[40d99efb:140ba232cec:-7fff, 6333954213550330995]]]]]
which 192.168.0.104 is the old IP and it should be 10.0.1.104
I've check the host file and my code, there is no anything like 192.168.0.*
Please help, Thank you.
UPDATE
I have confirmed this is a server registry problem. But I have already restarted the server. I did't remember what else did I do to the registry. Is there any way to set it manually?
UPDATE
I rune this code on that server InetAddress.getLocalHost().getHostAddress(), it returned 192.168.0.104, that can explain where this address came from. But there is no such address on the server now
SOLVED
I found java use a hostname to lookup localhost address, that hostname is not localhost and have not been updated by OS X Server for some reason. I updated the record from OS X Server console and solved this annoying problem.
NEVER THOUGHT ABOUT THAT

Resources