How do I access the web server or website using link local IPv6 address? - webserver

Below is the output of the ipconfig of the machine where web server is hosted:
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : Link-local IPv6 Address . .
. . . : fe80::f85b:4256:ee76:24a4%11 IPv4 Address. . . . . . . . .
. . : 10.213.254.119 Subnet Mask . . . . . . . . . . . :
255.255.255.0 Default Gateway . . . . . . . . . : 10.213.254.252
I can access the website using say: "http://10.213.254.119/test"
Now I am interested to know how can I access the same page using link local IPv6 address?

I found that most browsers don't support scope identifiers in URLs. Since scope identifiers are usually required for link-local addresses, that means those browsers can't access link-local addresses. Creating a DNS entry pointing to the link-local address won't work either since the DNS entry cannot specify a scope identifier.
Sometimes I have needed to access the webinterface of equipment which wasn't even on the same link. That means I would have two obstacles preventing me from using a link-local address to access it. But I found a simple method which solved both of those problems for me.
Run an ssh client on the host where the browser is running. Connect to a host with a direct link to the equipment I want to access through a link-local address, and set up a port-forwarding. For example the command to do so could look like this:
ssh -L '8080:[fe80::200:5eff:fe00:53b6%eth0]:80' host.example.com
At this point I can access it through localhost, which doesn't require a scope identifier: http://[::1]:8080/. This of course also works if ssh client and ssh server happen to both be running on the same machine as the webbrowser.

You can access it using curl as:
curl -6 -g --interface eth0 "http://[e80::f85b:4256:ee76:24a4]:8080" -vvv

Most browsers don't support that, and even if they did you would have to use a URL like http://[fe80::f85b:4256:ee76:24a4%eth0]/ where eth0 is the identifier of the link on the client system, and so can be different for each client.
Better to use routable IPv6 address.

Related

Windows network device driver: set network interface name

I am writing a network device driver for Windows. I have got the driver working but it shows up as generic Ethernet 2 in both ipconfig output and in Control Panel>Network Adapters. How do I set the interface name to a custom name from within the driver code? I do not want to do it from user level tools.
ipconfig output:
Ethernet adapter Ethernet 2:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::b5d1:2ce1:3e7c:5aa7%18
Autoconfiguration IPv4 Address. . : 169.254.90.167
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
Network Adapters GUI screenshot:
Control Panel>Network Adapters
Windows does not have any feature for a NIC driver to name itself.
Naming is a bit more complicated than it looks:
Windows localizes the name into the user's language and in some cases, automatically updates the name if the system locale changes.
In one legal jurisdiction, the OS implements special government-mandated naming rules.
When using the "Consistent Device Naming" feature, Windows incorporates the PCI bus topology into the network interface's name.
In the future, we may implement new naming features, like allowing the administrator to name all NICs after their MAC addresses.
Allowing the NIC driver to directly assign its own name would undermine the OS's ability to deliver features like those.
Source: I wrote the OS code to determine the name that is assigned to a newly-installed network interface.
Maybe there's another way to solve this problem? What is the ultimate problem you want to solve? (Stack Overflow isn't a discussion board, so an in-depth discussion with back-and-forth is difficult here. Many Windows driver developers hang out on the OSR forum instead.)

Port Forwarding through my home modem

I am trying to do port forwarding by using my JioFi modem .
After setting up all configurations , I am getting port closed when I use online website to check the port status.
I am not able to find out the problem . I have tried disabling the firewall too .
Below is detailed steps I did to port forward (I am mentioning it because their may be few things I may have missed while setting up things ...)..
(My System in Ubuntu 14.04) ..
1) Logged in to router home page . (My JioFi's web UI)
2)Went to port forwarding menu and set the Local port and WAN port as 12345 ans saved the settings .
3)Started a simple server at 12345 .
4) Used http://www.yougetsignal.com/tools/open-ports/ website to check the port but it showed port closed ...
Please help . A detailed stepwise answer would be really helpful .
I used following website to learn about port forwarding :- https://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/
What is the wan IP your router get? If the wan IP is in private range https://en.m.wikipedia.org/wiki/Private_network, port forwarding at the router will not help because port forwarding has to be done at ISP as first NAT happens there. If your router has public wan IP then port forwarding should work. In the case of private IP use third party tunneling service like ngrok to access your site publicly

Network connection to use when sending UDP messages from Windows PC to VMware machine?

I'm doing a little socket programming and encountered a network behavior that I don't understand; I'm hoping someone can shed some light on what is happening.
I'm running Windows 7 Professional on a PC. I've got VMware installed and am running QNX Neutrino RTOS as a target within the VMware session. So the Windows PC is the host PC, and the guest OS is the QNX Neutrino RTOS. I configured the virtual machine to use a NAT network connection.
Ok, now on to the IP and interface configurations. Running 'ipconfig' on my Windows machine gives the following:
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::c558:ae9f:e58e:e005%24
IPv4 Address. . . . . . . . . . . : 192.168.184.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet8:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::fce2:d22f:9ec:bd005%25
IPv4 Address. . . . . . . . . . . : 192.168.248.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
(** Other entries omitted for brevity **)
When I run 'ifconfig' on the VMware QNX system, I get the following:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
inet 127.0.0.1 netmask 0xff000000
ni0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
capabilities tx=3f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM,TSO4>
enabled=0
address: 00:0c:29:04:00:ae
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 192.168.184.15 netmask 0xffffff00 broadcast 192.168.184.255
ni1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
capabilities tx=3f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM,TSO4>
enabled=0
address: 00:0c:29:04:00:b8
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 192.168.248.15 netmask 0xffffff00 broadcast 192.168.248.255
So far, so good. Now, my socket program running on the VMware machine can successfully send a UDP message from VMware IP address 192.168.184.15 (port 65527) to the Windows PC 192.168.1.100 (port 2023), and my Windows socket program receives the message. However, when I try to send a UDP message from my Windows machine with IP address 192.168.1.100 (port 2044) to the VMware machine at 192.168.248.15 (port 2045), somehow the messages aren't reaching their destination. I did verify using Wireshark that the UDP message is on the wire with the expected IP source address and IP destination address, but even so, the socket program running on the VMware machine just doesn't receive the UDP message.
What I can do, though, is send a UDP message from Windows machine with IP address 192.168.248.1 to 192.168.248.15. When I do this, the socket program running on the VMware machine gets the UDP message. But what I'd like to know is why can't I successfully send a message from 192.168.1.100 to 192.168.248.15? Do I need to use some other type of network connection, other than NAT?
NAT is the very reason why you are able to send and receive from your VMWare machine and not reverse.
The reason is that while sending, NAT is going to build a translation table containing the original IP address and port and then use a different IP address and port. When an answer comes, this table is consulted and the reply is delegated back to the original IP address and port.
If a message comes in for which there is no entry in the translation table, the message will be dropped. This is the same reason why you cannot send a message to say your neighbor if he is behind those typical home routers that also use NATPAT.
You can solve this by using a demiliterized zone or port forwarding. But how to do that in vm is unknown to me.

Access local site with subdomain on iPhone

I understand that you can access your computer's local site from a mobile device running on the same network by entering your computer's IP address (with relevant local port) into the address bar. However, I often use subdomains for development. On my local I access subdomains using lvh.me. For example:
blog.lvh.me
However, this will not work for mobile because lvh.me is redirecting to the IP 127.0.0.1 .
Is there a way to access a subdomain on an IP address? Essentially, doing the same thing as the above code but allowing for a dynamic IP address depending on the IP my computer has at the time?
So, after continuing research, I found an awesome tool that allows for exactly the above functionality:
xip.io
For example, if my computer has the IP address of 124.4.1.3 and I was running a web server at blog.lvh.me, where lvh.me redirects to localhost or 127.0.0.1, I could access my computer's localhost from another device on the network using blog.124.4.1.3.xip.io
I hope that helps someone!
Sidenote: The app in question was running on a rails server and the above setup required the following setting to be added to the environments/development.rb file:
config.action_dispatch.tld_length = 5
As rails was running on port 3000, this also required a url like:
blog.124.4.1.3.xip.io:3000

How to use the vSphere SDK for Perl with IPV6 hosts

I'm attempting to refactor old perl code to support some new IPV6-only hosts.
In testing the basic 'connect.pl' script, it fails with
Unsupported IP address format:
#/usr/lib/vmware-vcli/apps/general/connect.pl --url https://fe80::b6b5:2fff:fe5a:c5d8:443/sdk --username root --password pw
Unsupported IP address format
I also wrote a little test script to exercise Util::connect, and it fails in the same way.
Caveats:
I'm using VMware-vSphere-Perl-SDK-5.1.0-780721.
In my scenario, the ESXi hosts run IPV6 only, and the guests will run IPV4 only.
You have two issues here.
IPv6 literal addresses in a URL need to be in brackets.
Your link-local address is missing an interface identifier.
Specify the link-local address in brackets with the correct interface identifier. For example:
https://[fe80::b6b5:2fff:fe5a:c5d8%eth0]:443/sdk
The correct answer here is that, for unknown reasons, the API checks for link-local "fe80" addresses, and errors if it sees them.
connect.pl (which is sample code provided by VMware) works just fine with a global-scoped IPV6 address.