๊ฐ์ ํ๊ฒฝ์์ Linux๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์๋ ๊ณ ์ IP ์ค์ ์ด ๊ฑฐ์ ํ์์ด๋ค.
(DHCP ๋ง๋ฃ๋ก ์๋ฒ ๋ด๋ถ IP๊ฐ ๋ณ๊ฒฝ๋๊ฑฐ๋ํ๋ฉด ํฌํธํฌ์๋ฉ ์ ์ฑ ์ ์ํด ์๋ฒ ์ ์์ด ํ๋ค ์๋ ์๋ค๋ ๋ญ๋ผ๋)
๋ด๋ถ IP๋ฅผ ์ ๋์ด ์๋ ๊ณ ์ IP ๋ฐฉ์์ผ๋ก ๋ฐ๊พธ๋ ค๋ฉด ๋คํธ์ํฌ ์ค์ ์ static์ผ๋ก ๋ณ๊ฒฝํด์ฃผ์ด์ผ ํ๋ค.
(Ubuntu 16.04 ๊ธฐ์ค) ๊ณ ์ IP ์ค์ ๋ฒ
๊ณ ์ IP๋ฅผ ํ ๋นํ๊ธฐ ์ํด IP๊ฐ ์ค์ ๋์ด ์๋ ๋คํธ์ํฌ ์ค์ ํ์ผ๋ก ๋ค์ด๊ฐ๋ค.
sudo ๊ถํ์ด ์๋ ๊ฒฝ์ฐ ์ฝ๊ธฐ ์ ์ฉ์ผ๋ก๋ง ์ด๋ ค ์์ ํ ์ ์ฅ์ด ๋ถ๊ฐ๋ฅํ๋ ๊ผญ sudo๋ก ์ ์ํ์.
$ sudo vi /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
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
dhcp๋ฅผ ์ฌ์ฉํ์ง ์๊ณ static์ผ๋ก ๋ณ๊ฒฝํ ๊ฒ์ด๋ฏ๋ก ์ฃผ์์ฒ๋ฆฌํด์ค๋ค.
๋ง์ฝ static ์ ์ IP์์ ๋ค์ ๋์ IP๋ก ๋ณ๊ฒฝํ๊ณ ์ถ๋ค๋ฉด ๋ฐ๋๋ก ์์ฑํ ํญ๋ชฉ๋ค์ ์ฃผ์์ฒ๋ฆฌํ๊ณ dhcp ์ค์ ์ ํ์ด์ฃผ๋ฉด ๋๋ค.
# 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
# The primary network interface
# auto enp0s3
# iface enp0s3 inet dhcp
๊ทธ๋ฆฌ๊ณ ์๋์ ์์ ์ด ์ฌ์ฉํ ๋คํธ์ํฌ ์ ๋ณด๋ฅผ ์ ๋ ฅํด์ฃผ๋ฉด ์ค์ ์ด ์๋ฃ๋๋ค.
network๋ผ๋ ์ต์ ๋ ์๋๋ฐ, netmask๋ฅผ ์ง์ ํ ๊ฒฝ์ฐ ์๋ตํด๋ ๋๋ค.
- auto [์ธํฐํ์ด์ค ์ด๋ฆ] : ๋ถํ ์ ํด๋น ์ธํฐํ์ด์ค๋ฅผ ์๋์ผ๋ก ํ์ฑํ
- iface [์ธํฐํ์ด์ค ์ด๋ฆ] [ํ๋กํ ์ฝ] [์ฐ๊ฒฐ ํ์
]
- ํ๋กํ ์ฝ : inet ๋๋ inet6
- ์ฐ๊ฒฐ ํ์ : static(๊ณ ์ ), dhcp(๋์ ), ppp(๋ค์ด์ผ์ )
auto enp0s3
iface enp0s3 inet static
address [๋ด๋ถ IP ์ฃผ์ - ๋ณ๊ฒฝํ IP๋ฅผ ์ํ๋ ๋๋ก ์
๋ ฅ]
broadcast [๋ธ๋ก๋์บ์คํธ - address์ ๋์๋ฆฌ๋ฅผ 255๋ก]
netmask [์๋ธ๋ท๋ง์คํฌ]
gateway [๊ฒ์ดํธ์จ์ด]
dns-nameservers [DNS, ๋ณด์กฐDNS (๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถํ์ฌ ์์ฑ)
์ค์ ํ ์ ์ฅ(:wq!)ํด์ฃผ๊ณ , ๋คํธ์ํฌ ์๋น์ค๋ฅผ ์ฌ์์ํ๋ค.
$ sudo systemctl restart networking.service
IP ๋ณ๊ฒฝ์ด ์ ๋์๋์ง ํ์ธํ๊ณ , (๋ณ๊ฒฝ์ด ์๋ ๊ฒ์ผ๋ก ํ๊ธฐ๋ ์ ์์)
$ ifconfig
์ฌ๋ถํ ํ๋ค. (์ฌ๋ถํ ํด์ผ IP๊ฐ ์ ์์ ์ผ๋ก ์ ์ฉ๋๋ค)
$ sudo reboot
'๐ OS > Linux-๋ฆฌ๋ ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Linux] ์ฉ๋ ๊ฝ ์ฐผ์ ๋, ๊ณต๊ฐ ์์ ๋ ์ฉ๋ ํฐ ํ์ผ ์ถ์ ํ์ฌ ์ญ์ ํ๊ธฐ (0) | 2023.03.21 |
---|---|
[E] piix4_smbus 0000:00:07.3: SMBus Host Controller not enabled! (0) | 2023.03.21 |
[E] No protocol specified (0) | 2022.08.01 |
[E] E: Sub-process /usr/bin/dpkg returned an error code (1) (0) | 2022.07.26 |
[E] /bin/sh^M: bad interpreter: No such file or directory (0) | 2022.07.26 |