Categories
Computer Network

우분투 20.04 에서 네트워크 설정하기 (고정 IP 주소, 자동할당 IP 주소)

우분투 20.04 에서 네크워크 설정 파일은 /etc/netplan 디렉토리에 저장되어 있다. 네트워크 설정 파일의 확장자는 .yaml 이다.

우분투 20.04를 새로 설치했을 때 디폴트로 만들어지는 네트워크 설정 파일은 /etc/netplan/00-installer-config.yaml 이다. 이 파일을 편집하여 네트워크 설정을 변경할 수 있다.

sudo vi /etc/netplan/00-installer-config.yaml

고정 IP 주소 세팅하기

/etc/netplan/00-installer-config.yaml 파일의 내용:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: false
      addresses:
      - 192.168.0.101/24
      gateway4: 192.168.0.1
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4

파일을 편집하고 저장을 마쳤으면 아래 명령으로 변경 사항을 시스템에 적용한다.

sudo netplan apply

DHCP 서버를 통한 IP 주소 자동 할당

/etc/netplan/00-installer-config.yaml 파일에서 dhcp4: 부분을 true 로 바꾼다. addresses: 부분, gateway4: 부분, nameservers: 부분은 삭제한다.

/etc/netplan/00-installer-config.yaml 파일의 내용:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: true

26 replies on “우분투 20.04 에서 네트워크 설정하기 (고정 IP 주소, 자동할당 IP 주소)”

I’m really enjoying the design and layout of your site.
It’s a very easy on the eyes which makes it much more enjoyable
for me to come here and visit more often. Did you hire out
a designer to create your theme? Fantastic work!

Do you mind if I quote a few of your posts as long as I
provide credit and sources back to your website?
My blog site is in the very same area of interest as yours and my visitors would genuinely benefit from some of
the information you present here. Please let me know if this alright with you.
Appreciate it!

My programmer is trying to convince me to move to .net from
PHP. I have always disliked the idea because of the
costs. But he’s tryiong none the less. I’ve been using WordPress on several
websites for about a year and am concerned about switching to another platform.

I have heard great things about blogengine.net. Is there a way I can transfer all my wordpress content into
it? Any help would be really appreciated!

I’d like to thank you for the efforts you have put in writing this site.

I am hoping to see the same high-grade blog posts by you in the future as well.

In fact, your creative writing abilities has inspired me to
get my very own website now 😉

When I initially left a comment I appear to have clicked the
-Notify me when new comments are added- checkbox and from now on each time
a comment is added I recieve 4 emails with the same comment.
Perhaps there is a way you can remove me from that service?
Cheers!

When someone writes an post he/she maintains the image of
a user in his/her mind that how a user can understand it. Therefore that’s why this
post is perfect. Thanks!

Hi there very cool site!! Man .. Beautiful .. Wonderful ..
I will bookmark your web site and take the feeds also?
I am happy to search out a lot of helpful information right here in the post, we
need work out extra strategies on this regard, thanks for sharing.
. . . . .

I’m not sure exactly why but this site is loading
extremely slow for me. Is anyone else having this issue or is
it a issue on my end? I’ll check back later and see if the problem still exists.

Leave a Reply

Your email address will not be published. Required fields are marked *