[Linux] Network Setting

2023. 2. 7. 14:53·Computer/Linux
728x90
728x90

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

/etc/network/interface 나 /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의 경우 가급적 /etc/network/interface 에 DNS server를 설정하는 게 좋다.
https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving
위 링크에서 따르면 Ubuntu에서 /etc/resolv.conf의 관리를 resolveconf로 변경되었고, resolveconf로 인해 수동편집으로 바꿔봐야 resolveconf가 덮어쓴다. 즉, 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

728x90

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

[vim] VI : carriage return 제거하기 : CRLF → LF  (0) 2023.07.14
[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' 카테고리의 다른 글
  • [vim] VI : carriage return 제거하기 : CRLF → LF
  • [Linux] vi (or vim) 사용법 정리
  • [Linux] 화면 캡쳐 단축키
  • [Linux] Debian 계열 패키지 관리 툴: apt, apt-get
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (785)
      • Private Life (15)
      • Programming (55)
        • DIP (116)
        • ML (34)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • 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
    • 기타 방사능관련.
  • 인기 글

  • 태그

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

  • 최근 글

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

티스토리툴바