I am using a Qubes HVM with Linux (Debian or any arbitrary Linux distribution) installed from ISO.
The network is not configured yet. Network manager DHCP is failing because Qubes does not provide a DHCP server. Therefore the network needs to be manually configured. I need to find out my assigned local VM internal IP address and gateway. No need for netmask no need because always 255.255.255.255. This could be done by looking at Qubes VM Manager in dom0 according to documentation.
However, I am looking for an alternative way that does not involve needing to look at dom0. I do not wish to use dom0 (Qubes VM Manager) to look up IP and gateway, because this cannot be automated from inside the VM.
Is there some way to auto detect the network settings IP, gateway to be used from inside the VM?
Is there some program, script to scan for this or bruteforce?
My end goal is to have a script/program to automate network configuration.
Qubes allows arbitrary gateway IP settings. Let’s say Qubes VM Manager (QVMM) shows Gateway10.137.0.54 then actually a gateway setting of 10.137.0.100 will be acceptable too. So that is 1 thing less to bruteforce. Much fewer combinations to try.
However, if QVMM shows IP 10.137.0.2 then another IP such as 10.137.0.3 will be rejected. Tested with ping 4.4.4.4 shows Destination Host Unavailable.
1 10.137.0.54 (10.137.0.54) 0.254 ms 0.200 ms 0.178 ms
Why traceroute? Because ping does not work.
Why | grep -v "traceroute to"? To hide traceroute’s banner to make it easier in the future to script this / parse its output.
If there was a better/faster command for that, this would help too.
Bruteforcing a permissible local VM IP is still todo.
If the VM lacks PV drivers (i.e. uses emulated ethernet instead of PV one), then it will get network configuration via DHCP. This DHCP server is running within stubdomain providing the emulated device and as such is not available for PV devices.
Are we dealing with a case where no DHCP client could be run and we still need to brute force the IP?
This is applicable to HVM too. No DHCP server available.
For all practical purposes, yes.
Kinda. There is an unimportant detail. A DHCP client can be run inside the VM but it would be of no use because Qubes does not provide a DHCP server. So the only way to not have to setup networking manually would be to burte force it.
That is, unless any of above linked tickets get implements or someone invents a better workaround.