Download & Install

[Linux] Ubuntu Server 설치 & 네트워크 설정

GGkeeper 2021. 11. 13. 05:37

실습> Ubuntu Server 설치하기

1. Ubuntu Server 다운로드
http://mirror.kakao.com/ubuntu-releases/21.10/ubuntu-21.10-live-server-amd64.iso

2. Ubuntu Server 설치
설치 시간은 10분 이상 소요되므로 완료까지 기다려야 한다.
설치가 완료되면 reboot now 문구가 뜨고 부팅하면 된다.
Virtual Machine name : UbuntuServer

3. 로그인
일반 사용자 계정으로 로그인한다.

콘솔 로그인 (직접 로그인)
$ sudo su -


원격 로그인 (터미널로 간접 로그인)
linuxmasternet@linuxmasternet:~$ sudo su -
[sudo] password for linuxmasternet:


4. 웹 서버 설치
apt : 패키지 관리 툴 (Advanced Package Tool 로 CentOS의 yum과 동일)
apache2 : 아파치 웹 서버 패키지 (CentOS httpd)

# apt -y install apache2
# systemctl enable apache2
# cd /var/www/html
# echo "Hello Ubunu server" > index.html
# ip a

    inet 192.168.108.7/24 brd 192.168.108.255 scope global ens33

http://192.168.108.7
Hello Ubuntu Server


실습> 우분투 네트워크 설정하기

Ubuntu Server 16.04
설정 파일 : /etc/network/interfaces

유동 IP주소일 경우
auto ens33
iface ens33 inet dhcp

고정 IP주소일 경우
auto ens33
iface ens33 inet static
address 192.168.108.7
netmask 255.255.255.0
gateway 192.168.108.2
dns-nameservers 168.126.63.1

네트워크 재시작
systemctl restart networking.service


Ubuntu Server 18.04, Ubuntu Server 20.04, Ubuntu Server 21.10
설정 파일 : /etc/netplan/<yaml파일>
/etc/netplan/00-installer-config.yaml

유동 IP주소일 경우

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      dhcp4: true
  version: 2


고정 IP주소일 경우

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      addresses:
      - 192.168.108.7/24
      gateway4: 192.168.108.2
      nameservers:
        addresses:
        - 168.126.63.1
        search: []
  version: 2


네트워크 재시작
netplan apply