메인 콘텐츠로 이동
  • 빠르고 간편하게 주문
  • 주문 보기 및 배송 상태 추적
  • 제품 목록을 생성 및 액세스

Ubuntu Server Networking

요약: In Ubuntu Server, configuring network interfaces is surprisingly straight-forward. As opposed to other Linux distributions, where there is a configuration

이 문서는 다음에 적용됩니다. 이 문서는 다음에 적용되지 않습니다. 이 문서는 특정 제품과 관련이 없습니다. 모든 제품 버전이 이 문서에 나와 있는 것은 아닙니다.

증상

In Ubuntu Server, configuring network interfaces is surprisingly straight-forward. As opposed to other Linux distributions, where there is a configuration file per each interface (which can be hard to manage), there is only one network interface configuration file in Ubuntu:

/etc/network/interfaces

Here is a basic example:

# The loopback network interface
auto lo
iface lo inet loopback

# Built-in NIC, port 1
auto em1
iface em1 inet dhcp

As you can see, the loopback interface and only one NIC port is defined, which is using DHCP. This file will be automatically populated when the OS is installed.

Say that you want to change from DHCP to a static IP address. How do you do it? Easy, though there is an extra step that may not be obvious:

1. Edit config file to look like this:

# The loopback network interface
auto lo
iface lo inet loopback

# Built-in NIC, port 1
auto em1
iface em1 inet static
address 192.168.1.7
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.254 # Your DNS server, if any
dns-search dlr.com # Your DNS search domain, if any

2. Restart networking service:

$ sudo /etc/init.d/networking restart

If using 12.04 or earlier, ignore the 'deprecated' warning message. If using 12.10 or later, you can instead use:

$ sudo restart networking

3. Shutdown the dhclient daemon, otherwise you will get an IP address from DHCP when the lease is renewed, regardless of what's specified in the configuration file:

$ sudo killall dhclient
$ sudo apt-get -y purge isc-dhcp-client

문서 속성
문서 번호: 000146536
문서 유형: Solution
마지막 수정 시간: 21 2월 2021
버전:  3
다른 Dell 사용자에게 질문에 대한 답변 찾기
지원 서비스
디바이스에 지원 서비스가 적용되는지 확인하십시오.