how to add network route while in debian install
hi
i was installing debian and was faced with a external gateway that can only be added using a route either in network/interfaces or by command line.
in the install i can exit to shell and set up the network but when i exit its all lost.
any help would be appreciated
Thanks
ejab
Comments
I had faced this while installing Debian from iso , had used VNC and added the IP and routes but they were persistent and not lost with mixed response
One one VPS they were persistent/saved first time and on second one they got saved after 3 attempts so probably try again
you mean you [ exit to shell ] then add the interface file exit then repeat multiple times?
What i did was
Added in shell , saved , restart still no network
Again VNC , shell , add network , restart and i am pretty sure saved it correctly
For one VPS I got network in 3rd attempt on another file got saved in first and got network
i am talking about this shell
I have never needed to do this myself, but here's what I would try.
ip route ...
command.ping
or whatnot.If you also want to configure the static route for the installed system while it's still being installed, you will need to edit the configuration files in /target/etc/network as the dialog upon launching of the shell suggests. The /target directory will only exist after the disks have been partitioned, and the base system installed; either way, I'd do these edits at the very end of the installation so that you can be sure no step of the installation will overwrite your changes.
Well i used VNC from the provider CP and added the entries for the network and that worked . Did not use this shell but finished the installation
Last time I had this I just finished the install without connectivity then added the specific network config once installed and modified the apt lists to use the correct address.
apt-get update
and the add anything missing that wasn't installed the first time.Yes exact same what i did and ran netselect-apt for closest mirror
You can press Ctrl+Alt+F2 or F3 to get to a terminal, but I am not certain if the
ip route
commands are available (it's usually a BusyBox-like or basic sh prompt, no bash).Cheap dedis are my drug, and I'm too far gone to turn back.
yes
network dialog still displays gateway is not reachable.
I am doing a net install, selecting do not configure network at this time does not continue.
i am using html vnc and no keyboard options.
Odd. I only have the netinstall ISO uploaded on the proxmox node that has an "odd" network setup and need a pointtopoint setup, so there must be a way to continue without networking?
i boot with ipxe , i do setup the ip,gateway then i chain the ipxe file , it start by try to configure the network.
maybe i google skip network setup in the pxe file if it exists.
Aah I was just using the netinstall ISO via VNC.
if i skip the network, i get stuck in loop miror
They are.
Then I see I was just restating what was already obvious to you. This is indeed odd, I've never run into this myself. Just out of curiosity, is this IPv4 or IPv6?
As more of an offshoot, what I did run into was, for example, that FreeBSD does not like it at all when the gateway is in a different subnet (at least for IPv6), and it won't work even if you configure a static route to it. I wonder if something in the Debian installer perhaps has certain limitations/quirks like this. But this is pure speculation on my part.
IPv4
this is what i am thinking.
Hmm, just tried using a netinstall ISO with skipped network config and I get the following:
This is the correct answer.
Yes,
ip
command is available by the time you get to network configuration page.Not an excuse.
The number after colon is "desktop number".
It equals port number minus 5900.
Accepting submissions for IPv6 less than /64 Hall of Incompetence.
Anyway, I tried a Debian 10 text installer on Nexril Dallas, booted via netboot.xyz.
Run command to setup IP address and routes, such as:
Test connectivity:
Type
exit
to come back to the main menu.Note:
You need to know the correct IP address, subnet mask, and default gateway.
ip addr; ip -4 route; ip -6 route
.This works for IPv6-only server as well.
Accepting submissions for IPv6 less than /64 Hall of Incompetence.
If it's a remote system there might not be "direct" VNC access. Some VMs use VNC via a management panel relay host.
Unless you've already solved the issue in a different way, here's something you can try.
After digging a little bit deeper, I discovered that it seems to be a simple case of the
Configure the network
step doing input data validation where it requires the gateway to be from the same subnet. I believe the following is a way to work around that while minimising having to do a lot of additional manual changes.Configure the network
step, leave the gateway value empty; it will not complain then.Configure the network
step, go to a shell, and execute the following commands while substituting the placeholders with appropriate values.Configure the network
step again)./target/etc/network
before rebooting.Step 4. can optionally be done after the reboot, but bear in mind that you will not have connectivity to anything outside of your subnet in the newly installed system until you do it.
this happens, if you gateway is not on the same subnet like your IP, e.g. proxmox using routed bridges you'll not be able to setup the network via the dialog, because it doesn't make it a host route automatically, even if you specify 255.255.255.255 as subnet mask.
as has been pointed out above, switch to a shell and use ip add/route to add what you need and get it working ;-)
yeeees finally, i got to work; thanks to all who helped with ideas and special thanks to yoursunny , rhinoduck , Falzo
the trick is to let it fail once without adding any value, choose to continue without if asked but must get back to main screen and enter shell and add ip,route like mentioned above.
Thank you guys , i appreciated it.
A little bit more detail for those interested...
This is where the error is coming from:
https://salsa.debian.org/installer-team/netcfg/-/blob/1.172/static.c#L592
https://salsa.debian.org/installer-team/netcfg/-/blob/1.172/netcfg-common.c#L1668
It is not that having a gateway on a different subnet would not work, it is just that the
Configure the network
step will not let you configure the network that way. That's why I suggested "fooling" it by leaving the gateway value empty when going through this step, because that will shut the error up, and it will let you continue the installation; granted you still need to manually add the routes using the shell once you're through this step if you want to have network access during the installation.Just leaving the gateway field empty instead of leaving the whole
Configure the network
step out has the advantage of you having to only manually configure the routes in the installer shell, and only the routes and the gateway value in the new system, instead of having to manually do the whole static network configuration twice (once for the installer, and once for the installed system).Great and completely written in short (y)
and for checking of gateway i use also these commands
route -n ; netstat -rn ; ip route show
Good day and Goodbye
route
andnetstat
are deprecated and no longer installed in newer systems.Use
ip route
andss
instead.Accepting submissions for IPv6 less than /64 Hall of Incompetence.
I think i am also quite deprecated so they are still ok for me also nowadays :-D
But seriously - thanks for the info & update.
Good day and Goodbye
Today I ran into this scenario when installing Ubuntu via netboot.xyz on a VPS that has an OVH failover IP, where the default gateway is in a different subnet.
In my situation, DHCP can give IPv4 address and gateway, but the Ubuntu installer would reject the DHCP result and ask for manual configuration.
The solution I gave a few days ago did not work: if I enter the IPv4 configuration first thing during installation, it would be overwritten when the installer executes DHCP, and then installation fails.
Instead, I had to:
ip route
commands.exit
the shell, and resume the installer at "select a mirror" step.The installed system would have a blank Netplan configuration, and I need to use VNC to configure network again.
Accepting submissions for IPv6 less than /64 Hall of Incompetence.