Показаны сообщения с ярлыком ip. Показать все сообщения
Показаны сообщения с ярлыком ip. Показать все сообщения

пятница, 23 августа 2019 г.

Настройка статического ip Ubuntu 18.04.3 server

$ sudo cat /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        enp1s0:
            dhcp4: true
    version: 2

$ sudo nano /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
# Закомментировать:
#       enp1s0:
#            dhcp4: true
#   version: 2

# Добавить:
         enp1s0:
            dhcp4: false
            dhcp6: false
            addresses: [192.168.10.24/24]
            gateway4: 192.168.10.1
            nameservers:
              addresses: [8.8.8.8, 8.8.4.4]
#     version: 2


Сохранить.

Применть:
$ sudo netplan apply
или
$ sudo netplan --debug apply

четверг, 2 августа 2018 г.

Ubuntu сервер 1С:Предприятие замена ip

Потребовалось запустить сервер 1С:Предприятие в другой сети с DHCP
1.
$ sudo nano /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

#auto enp1s0

iface enp1s0 inet dhcp

#iface enp1s0 inet static
#address 192.168.10.29
#netmask 255.255.255.0
#gateway 192.168.10.1
#dns-nameservers 8.8.8.8

auto enp1s0

Сохранить.
$ sudo reboot

или

$ sudo service networking restart

Смотрим ip адрес:
user@s1030:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 2c:4d:54:4c:f0:50 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.52/24 brd 192.168.0.255 scope global enp1s0
       valid_lft forever preferred_lft forever


2.

$ sudo nano /etc/hosts
Корректируем или добовляем:

192.168.0.52 s1030

Сохранить:

$ sudo service smbd restart
$ sudo service nmbd restart

или
$ sudo reboot

Защита от замены роутера:

3. Меняем статический адрес, на динамический который выдал DHCP

1.
$ sudo nano /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

#auto enp1s0

#iface enp1s0 inet dhcp

iface enp1s0 inet static
address 192.168.0.52
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8

auto enp1s0

Сохранить.
$ sudo reboot

Смотрим файлы hosts на клиентах, что бы там не попадались с именем s1030

Если имя сервера не менялась, кластер серверов 1С продолжает работать с новым ip.