#981 Issue closed: Change network-settings on rescue-boot

Labels: support / question, fixed / solved / done

e-it opened issue at 2016-08-25 07:49:

  • rear version (/usr/sbin/rear -V): Relax-and-Recover 1.17.2 / Git
  • OS version (cat /etc/rear/os.conf or lsb_release -a): CentOS release 6.7 (Final)

Is it possible to change the network-settings on boot of the rescue-image? I would like to try the restore with bacula on a local VM but the network-configuration contains an IP that does not belong to my network so the network is unreachable.

gdha commented at 2016-08-25 08:14:

@e-it sure - just like you do on a production system you can use ip or ifconfig to modify your network settings.

e-it commented at 2016-08-25 08:29:

Okay, so I got it to work doing:

ifconfig eth0 192.168.10.123 netmask 255.255.255.0 up
ip route add 192.168.10.1 dev eth0
ip route add default via 192.168.10.1

But: Now I see that there is only one name server (127.0.0.1) - the director's host name can not be resolved this way. Is there any way to get a public name server into the config?

jsmeix commented at 2016-08-25 08:50:

@e-it
when you use the newest GitHub master code
there is support for NETWORKING_PREPARATION_COMMANDS
so that you can define in etc/rear/local.conf whatever
commands you need for networking setup in the
recovery system, see
https://github.com/rear/rear/blob/dev/usr/share/rear/conf/default.conf
how NETWORKING_PREPARATION_COMMANDS
is meant to work and for some examples how it works see
https://github.com/rear/rear/pull/960#issuecomment-239448861

gdha commented at 2016-08-25 10:23:

@e-it You can edit the /etc/resolv.conf file as well, or use @jsmeix suggestion.

e-it commented at 2016-08-25 10:29:

Hm, but if I edit the resolv.conf I would have to restart the networking - and /etc/init.d does not contain a networking-init-script or am I wrong?

didacog commented at 2016-08-25 10:37:

@e-it changes in /etc/resolv.conf should take effect immediately. No need to restart networking.

regards,

gdha commented at 2016-08-25 12:02:

@e-it can this issue be closed?

e-it commented at 2016-08-25 12:04:

Yes, thanks. The changes in /etc/resolv.conf do not take effect immediately, but it's possible to edit /etc/hosts


[Export of Github issue for rear/rear.]