User Tools

Site Tools


Sidebar

linux:network_setting

네트워크 설정

고정 아이피 잡기

리눅스 네트워크 관련 설정파일

  • /etc/sysconfig/network-scripts/ifcfg-eth0 → 아이피,서브넷 마스크,(게이트웨이)
    • # vi /etc/sysconfig/network-scripts/ifcfg-eth0
    • DEVICE=eth0 
      BOOTPROTO=static 
      BROADCAST=192.168.0.255 
      IPADDR=192.168.0.150 
      NETMASK=255.255.255.0 
      NETWORK=192.168.0.0 
      ONBOOT=yes 
      TYPE=Ethernet
    1. /etc/sysconfig/network → 컴퓨터이름,(게이트웨이)
    • #vi /etc/sysconfig/network
    • NETWORKING=yes 
      HOSTNAME=sg150 
      GATEWAY=192.168.0.1
    1. /etc/resolv.conf → DNS 정보
    • # vi /etc/resolv.conf
    • nameserver 168.126.63.1
    1. /etc/hosts → 네임서버 파일
    • # vi /etc/hosts
    • # Do not remove the following line, or various programs 
      # that require network functionality will fail. 
      192.168.0.150           sg150 localhost.localdomain localhost
    1. # service network restart
linux/network_setting.txt · Last modified: 2019/02/25 14:59 (external edit)