Score:2

Can I bring up a network interface even when its disconnected?

kw flag

I'm running Ubuntu Server 20.04.

I have python3 http server running. I can connect to the eth port and access it at 192.168.1.12.

If I disconnect the ethernet and then remote access the system via wifi (direct hotspot) instead, I can't access it at 192.168.1.12, but I can at my configured wifi address of 192.168.2.12.

Next, if I connect ethernet, but still access the unit via the wifi hotspot, I can now reach it at 192.168.1.12.

So I'm wondering how I can keep that accessibility even without the ethernet connected.

I hope that makes sense.

Rohit Gupta avatar
pg flag
What are you connecting with (the client) ? If its a windows desktop or laptop, I have an answer
ditch avatar
kw flag
The clients will be windows laptops, preferably over wifi
Score:0
pg flag

You can configure Windows PCs to use multiple IP addresses to connect to multiple DHCP servers. This can be achieved on Windows as follows -

Assuming that you leave your PC connected by ethernet. So you can access the server at 192.168.1.12

  1. Click on the Network Icon on Taskbar
  2. Click on Change Adapter Options
  3. Click on the ethernet card (its the one that hasn't got Not Connected, TAP, VPN, TeamViewer etc beside it)
  4. Click on Properties button
  5. Select Internet Protocol Version 4
  6. Click on Properties button
  7. You can leave Obtain an IP address automatically or set up a preferred IP Address. This is for your ethernet connection.
  8. Click on Advanced button
  9. Under IP addresses, Click on Add button
  10. Enter 198.168.2.xxx and subnet of 255.255.255.0
  11. Click on Add button
  12. Keep pressing Ok as you exit out.

Where xxx is any valid, unique IP address that you want your laptop. Now you are connected to two subnets. 192.168.1.xxx and 192.168.2.xxx

Swap step 10 to 192.168.1.xxx if your laptop would normally connect to WIFI.

If you dont want to select an IP address, set up the gateway instead. The image shows both values filled in. I have a similar setup.

Setup

Last Note

I have the metric set as auto, Windows should sort it out as Wifi is slower than ethernet. If you need to steer the traffic then read this

Pilot6 avatar
cn flag
How is this related to the question?
Rohit Gupta avatar
pg flag
Perhaps you are reading the question differently to me. I am reading it as the OP wanting to connect to two subnets at the same time.
Pilot6 avatar
cn flag
I am reading that OP has an Ubuntu Server, not a Windows PC.
Rohit Gupta avatar
pg flag
Before answering, I asked him. See comments. he has windows laptops (clients).
Rohit Gupta avatar
pg flag
@Pilot6 - If you think that I have the wrong end of the stick, I can delete my answer.
ditch avatar
kw flag
Thanks Rohit, that would certainly be an acceptable answer. Only issue is that I won't necessarily be able to make the changes for anyone he needs to access this, and they actually often run a batch file that's sets the IP to common addresses we need to access. I actually went ahead and just changed the WiFi IP to a different common IP we use to make it simpler. Thank your for your help though!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.