What's new

Create/open socket

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

itpp20

Senior Member
Is it possible to create/open an IP socket+local IP address without a network stack being configured?
For example, a windows box has 1 network defined, if you set IP fixed you are allowed to add extra IP addresses, all nice and well but I would like to do this without a defined network (sort of like a loopback lan without defining it, or 127.0.0.1 which is always there lan or not).
 
I don't see how you can have an "IP socket+local IP address", which is by definition a network object and yet not have a "network stack". :confused:

Maybe you're thinking along the lines of IPC (e.g. unix domain sockets, pipes, shared memory, etc.)?
 
If you look at the OS build-in loopback (127.0.0.1) , in windows there is no adapter configured, no real stack defined and yet the address exists and can be used. I am looking for a way to add other ranges to this build in range.
 
I know I can install additional loopback adapters but I'd prefer not to if I can get away with expanding localhost.
 
I know I can install additional loopback adapters but I'd prefer not to if I can get away with expanding localhost.
I was just about to suggest that.

What do you mean by "expanding"? IIRC the loopback adapter is /8 so you could for example use 127.3.2.1 as an address.
 
I'd like to add for example 192.168.1.1
I can do this with an extra loopback adapter or adding this address to an existing static adapter but I don't want to either way.

The use case is as follows,
A connects to B, A and B are on the same subnet, B returns html responses which have hardcoded addresses, which is not a problem when client is on same subnet.

A connects to B via C (ssh), the html responses contain the address of the subnet B is on, since A looks at localhost to return data nothing happens.

If I add the local address of B to A as adapter I can tell ssh to listen on the address and pass it via the tunnel already running. This works perfectly but requires an extra loopback adapter or adding this address to an existing static adapter. It would be faster (and easier to revert) to expand localhost, having listening sockets ssh can use.

Hmm an idea just comes to mind, what if I added a route ?
route add 192.168.1.1 mask 255.255.255.255 127.0.0.1

https://stackoverflow.com/questions...-packet-to-use-localhost-as-a-gateway/4941233

But then on windows.
 
No idea how you'd do it in Windows, but in Linux I'd try using an alias something like this:

ifconfig lo:0 192.168.9.1 netmask 255.255.255.255

But for all the time you've spent on this I would have just setup another loopback adapter and be done with it.
 
Similar threads
Thread starter Title Forum Replies Date
G Multiple tries needed to open windows share Other LAN and WAN 0

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top