[Linux] Network Setting

2023. 2. 7. 14:53·Computer/Linux
728x90
728x90
이 문서의 내용은 구버전에 해당함.
최신 버전이 아님.

 

 

Ubuntu의 경우, network manager 패키지에 설정된 것이 우선권을 가진다고 한다.

 

/etc/network/interfaces 나 /etc/resolv.conf를 직접 수정해도 적용이 안 된다면,

이 때문일 확률이 높다.


Configuring DHCP address for your network card

If you want to configure DHCP address you need to edit the /etc/network/interfaces and
you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

 

다음과 같이 편집.

# The primary network interface - use DHCP to find our address  
auto eth0  
iface eth0 inet dhcp

Configuring Static IP address for your network card

If you want to configure Static IP address you need to edit the /etc/network/interfaces and
you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

 

다음과 같이 편집.

# The primary network interface  
auto eth0  
iface eth0 inet static  
address 192.168.3.90  
gateway 192.168.3.1  
netmask 255.255.255.0  
network 192.168.3.0  
broadcast 192.168.3.255

# Setting for the domain name system server
dns-nameserver 168.126.63.1 168.126.63.2 8.8.8.8 

 

반드시 설정 변경 이후 netwowrk를 재시작하자.
After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

Setting up DNS

Ubuntu에서 DNS 설정 위치는 사용하는 네트워크 관리 방식에 따라 달라진다.

Ubuntu의 경우 가급적 /etc/network/interface 에 DNS server를 설정하는 게 좋다.
구버전 Ubuntu 또는 `ifupdown` 기반 환경에서는 `/etc/network/interfaces`에 `dns-nameservers`, `dns-search` 항목을 설정하고, 이 값이 `resolvconf`를 통해 `/etc/resolv.conf`에 반영되도록 할 수 있다.

https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving

위 링크에서 따르면
Ubuntu에서 /etc/resolv.conf의 관리가 resolvconf로 변경되었고,
resolvconf로 인해 수동편집으로 바꿔봐야 resolvconf가 덮어쓴다.
때문에, resolveconf를 사용해야 한다.

/etc/resolv.conf
수정으로 충분한 경우만 아래를 참고.

When it comes to DNS setup Ubuntu doesn’t differ from other distributions.
You can add hostname and IP addresses to the file /etc/hosts for static lookups.

To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.

For example a machine which should perform lookups from the DNS server at IP address 192.168.3.2 would have a resolv.conf file looking like this

sudo vi /etc/resolv.conf

 

다음과 같이 편집.

search test.com  
nameserver 192.168.3.2

References

https://webdir.tistory.com/188

 

[Ubuntu] 우분투 네트워크 설정

우분투 12.04.02 버전에서 테스트 되었음 우분투 데스크탑 네트워크 설정 우분투 데스크탑 버전에서는 네트워크 매니저라는 패키지가 그 어떤 네트워크 설정보다 우선순위가 높다. 즉, /etc/resolv.co

webdir.tistory.com

 

728x90

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

[Linux] Signal : SIGINT  (0) 2023.04.09
[Linux] vi (or vim) 사용법 정리  (0) 2023.03.21
[Linux] 화면 캡쳐 단축키  (0) 2023.01.30
[Linux] Debian 계열 패키지 관리 툴: apt, apt-get  (0) 2023.01.26
[Linux] nano Editor 간단 사용법  (0) 2023.01.10
'Computer/Linux' 카테고리의 다른 글
  • [Linux] Signal : SIGINT
  • [Linux] vi (or vim) 사용법 정리
  • [Linux] 화면 캡쳐 단축키
  • [Linux] Debian 계열 패키지 관리 툴: apt, apt-get
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (795)
      • Private Life (16)
      • Programming (212)
        • DIP (116)
        • ML (41)
      • Computer (121)
        • CE (54)
        • ETC (31)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (12)
      • ... (369)
        • Signals and Systems (115)
        • Math (177)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    인허가제도
    fourier transform
    signal_and_system
    Probability
    random
    Python
    Optimization
    numpy
    function
    signals_and_systems
    cv2
    Term
    SS
    opencv
    Vector
    math
    ML
    linear algebra
    Programming
    SIGNAL
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[Linux] Network Setting
상단으로

티스토리툴바