1 개요[ | ]
- 우분투 IP 설정
Bash
Copy
vi /etc/network/interfaces
Bash
Copy
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
dns-search example.com
dns-nameservers 192.168.3.45 192.168.8.10
2 설명[ | ]
- auto [인터페이스 이름]: 부팅 시 인터페이스를 자동으로 올려줌
- auto lo: 부팅 시 루프백 장치를 올려줌
- auto eth0 : 부팅 시 eth0 장치를 올려줌
- iface [인터페이스 이름] inet [static 또는 dhcp] : 인터페이스 이름의 네트워크 장치 설정
- static 또는 dhcp: 고정IP로 설정 할 것인지 유동IP로 설정 할 것인지 설정
- static으로 설정 할 경우
- address: IP주소 설정
- netmask: 기본 넷마스크 설정
- gateway: 기본 게이트웨이 설정
- dns-nameserver: 기본 네임서버
3 적용[ | ]
3.1 방법 1[ | ]
Console
Copy
# ifup eth0
# ifdown eth0
- → IP 설정 후 ifup, ifdown 명령을 통해 장치의 활성화 비활성화를 통하여 변경 사항을 반영을 할 수 있음
3.2 방법2[ | ]
Console
Copy
# /etc/init.d/networking restart
- → 네트워크 재시작을 통해서도 반영을 할 수 있음
4 같이 보기[ | ]
5 참고[ | ]
편집자 John Jeong Jmnote 211.37.27.137
로그인하시면 댓글을 쓸 수 있습니다.