practice / blog

For personal blogging
1 stars 0 forks source link

Linux static IP address #46

Open practice opened 7 years ago

practice commented 7 years ago

리눅스 고정 IP 세팅

검색하기 귀찮아서 기록

/ect/network/interfaces 파일 수정

iface eth0 inet static
address 172.16.114.133
netmask 255.255.255.0
gateway 172.16.114.1
# network 172.16.114.0
# broadcast 172.16.114.255
dns-nameservers 168.126.63.1 168.126.63.2

네트워킹 restart

$ sudo /etc/init.d/networking restart

요즘 시스템은 network restart를 이렇게 해야 하더라.

$ sudo ip addr flush eth0
$ sudo systemctl restart networking.service

물론 ifdown, ifup 도 동작한다.