반응형

Ubuntu 16


설정파일 : /etc/network/interfaces


고정 IP로 설정할 인터페이스를 확인후, 아래 내용과 같이 관련 네트워크 정보를 추가해 줍니다.


# interfaces(5) file used by ifup(8) and ifdown(8)

auto lo

iface lo inet loopback


auto enp0s31f6

iface enp0s31f6 inet static

    address 192.168.0.100

    netmask 255.255.255.0

    network 192.168.0.0

    broadcast 192.168.0.255

    gateway 192.168.0.1

    dns-nameservers 8.8.8.8 192.168.0.1

    dns-domain domain.com

    dns-search domain.com


root@localhost:~$ sudo systemctl restart networking





Ubuntu 18


설정파일 : /etc/netplan/.yaml


초기 설치 후 해당 폴터에서 확장자가 "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:

        enp0s31f6:

            addresses: [192.168.0.100/24]

            gateway4: 192.168.0.1

            nameservers:

                addresses: [8.8.8.8,192.168.0.1]

            dhcp4: no

    version: 2


root@localhost:~$ sudo netplan apply


반응형

'Server > Linux' 카테고리의 다른 글

firewall-cmd --new-service  (0) 2020.10.08
[BIND] CentOS 7에서 DNS 설치  (0) 2020.07.17
CURL 또는 LYNX로 웹 사이트의 헤더 정보 확인하기  (0) 2019.07.02
Linux tar  (0) 2019.06.26
Change the time zone on Linux  (0) 2018.11.07

+ Recent posts