우분투 네트워크 설정
2013. 11. 29. 15:17 |
리눅스
우분투 서버 네트워크 설정 방법
아래 파일에 영구 설정
/etc/network/interfaces
DHCP로 설정하는 예제
Static으로 설정하는 예제
변경내역 적용
ifdown eth0 && ifup eth0
또는
service networking restart
IP와 마찬가지로 아래 파일에 영구 설정
/etc/network/interfaces
추가 eth1이 있다고 가정하고 특정 대역 2개를 eth1로 돌리는 예제
다른 리눅스처럼 /etc/resolv.conf 에 설정해도 되기는 하지만
IP와 마찬가지로 아래 파일에 영구 설정
/etc/network/interfaces
KT DNS로 설정하는 예제
아래 파일에 영구 설정
/etc/hostname
변경내역 적용
hostname -F /etc/hostname
또는 직접 변경
hostname '변경할 이름'
또는 proc에 직접 변경
echo '변경할 이름' > /proc/sys/kernel/hostname
/etc/hosts 파일에도 반영해주도록 하자
1. IP 설정
아래 파일에 영구 설정
/etc/network/interfaces
DHCP로 설정하는 예제
auto eth0
iface eth0 inet dhcp
iface eth0 inet dhcp
Static으로 설정하는 예제
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
변경내역 적용
ifdown eth0 && ifup eth0
또는
service networking restart
2. Static Route 설정
IP와 마찬가지로 아래 파일에 영구 설정
/etc/network/interfaces
추가 eth1이 있다고 가정하고 특정 대역 2개를 eth1로 돌리는 예제
auto eth1
iface eth1 inet static
address 192.168.0.100
netmask 255.255.255.0
post-up route add -net 192.168.128.0 netmask 255.255.255.0 gw 192.168.0.1
post-up route add -net 192.168.192.0/24 gw 192.168.0.1
iface eth1 inet static
address 192.168.0.100
netmask 255.255.255.0
post-up route add -net 192.168.128.0 netmask 255.255.255.0 gw 192.168.0.1
post-up route add -net 192.168.192.0/24 gw 192.168.0.1
3. DNS 설정
다른 리눅스처럼 /etc/resolv.conf 에 설정해도 되기는 하지만
IP와 마찬가지로 아래 파일에 영구 설정
/etc/network/interfaces
KT DNS로 설정하는 예제
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 168.126.63.1 168.126.63.2
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 168.126.63.1 168.126.63.2
4. Hostname 설정
아래 파일에 영구 설정
/etc/hostname
변경내역 적용
hostname -F /etc/hostname
또는 직접 변경
hostname '변경할 이름'
또는 proc에 직접 변경
echo '변경할 이름' > /proc/sys/kernel/hostname
/etc/hosts 파일에도 반영해주도록 하자
'리눅스' 카테고리의 다른 글
우분투 apt-get Repositoy 변경 (8) | 2013.12.05 |
---|---|
리눅스 chpasswd 패스워드 변경 (7) | 2013.12.03 |
우분투 새로 생성한 사용자의 프롬프트 비어있는 이유 (1) | 2013.11.29 |
우분투 root 계정 사용하기 (1) | 2013.11.29 |
우분투 네트워크 설정 (4) | 2013.11.29 |
CentOS Daum Repository (1) | 2013.11.12 |
리눅스 history 시간 남기기 (1) | 2013.10.25 |
리눅스 root 패스워드 없이 su 사용하기 (1) | 2013.10.25 |
Are you sure you want to continue connecting (yes/no)? (5) | 2013.09.01 |
2013.11.29 16:02 신고
우분투 VHD 설치에 대한 포스팅은 없나요?
2013.11.29 18:49
우분투가 VHD 지원을 하면 VHD 설치가 가능하지만 그런 소리는 못들어봤습니다
2013.12.03 09:04
우분투관련 글을 스누피님 블로그에서도 볼 수 있다니 반갑기 그지없습니다.^^
2014.01.10 03:14
우분투는 잘 모르겠지만 레드헷계열은 랜카드 장치명을 확인하고 설정해야 오류없이 한번에 설정 되더라구요. 보통 eth0부터 순서대로 잡히지만 가끔 미쳐가지고 eth0이 잡혀야 하는데 eth1으로 잡혀 있기도 하고 그래서... 그거 확인하는 명령어가 아마 ip link였던거 같은데 우분투는 모르겠군요.