Lab155
Версия от 10:56, 8 ноября 2021; Vovan (обсуждение | вклад) (Новая страница: «=Скрипт переименования машин= <pre> IP=172.16.155.4 MASK=16 GW=172.16.1.1 HOST=alt-pve-155-4 echo "127.0.0.1 localhost" > /etc/hosts echo…»)
Скрипт переименования машин
IP=172.16.155.4 MASK=16 GW=172.16.1.1 HOST=alt-pve-155-4 echo "127.0.0.1 localhost" > /etc/hosts echo "$IP $HOST.local $HOST" >> /etc/hosts echo "$HOST" > /etc/hostname rm -rf /etc/net/ifaces/* mkdir /etc/net/ifaces/vmbr0 cat << EOF > /etc/net/ifaces/vmbr0/options TYPE=bri VLAN_AWARE=yes VIDS=2-2048 ONBOOT=yes DISABLED=no NM_CONTROLLED=no CONFIG_WIRELESS=no CONFIG_IPV4=yes CONFIG_IPV6=no BOOTPROTO=static HOST="eth0" EOF echo "$IP/$MASK" > /etc/net/ifaces/vmbr0/ipv4address echo "default via $GW" > /etc/net/ifaces/vmbr0/ipv4route echo "nameserver $GW" > /etc/net/ifaces/vmbr0/resolve.conf cat << EOF > /etc/sysconfig/network # When set to no, this may cause most daemons' initscripts skip starting. NETWORKING=yes # Used by hotplug/pcmcia/ifplugd scripts to detect current network config # subsystem. CONFMETHOD=etcnet # Used by rc.sysinit to setup system hostname at boot. HOSTNAME=$HOST # This is used by ALTLinux ppp-common to decide if we want to install # nameserver lines into /etc/resolv.conf or not. RESOLV_MODS=yes EOF