2017년 4월 22일 토요일

Centos 7 DHCP ip 설정

1. ifconfig 명령으로 현재 선언되어 있는 network device 이름 찾기

  
[root@localhost network-scripts]# ifconfig
eno16777736: flags=4163  mtu 1500
        inet 192.168.1.179  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::20c:29ff:fecb:3813  prefixlen 64  scopeid 0x20
        ether 00:0c:29:cb:38:13  txqueuelen 1000  (Ethernet)
        RX packets 313  bytes 294082 (287.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 247  bytes 26039 (25.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

2. 해당 network 파일 설정 변경

[root@localhost network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 

DEVICE=eno16777736
ONBOOT=yes
BOOTPROTO=dhcp
IPADDR=
NETMASK=
GATEWAY=#############
HWADDR=################

GATEWAY는 알맞는 gateway를 넣어줌.

3. network 설정 재실행

[root@localhost network-scripts]# ifup ifcfg-eno16777736 

댓글 없음 :

댓글 쓰기