우분투 고정 ip 설정

제목 관련 질문을 하려고 합니다.

제 시스템은 [b:1fyha61o]BeagleBone Black[/b:1fyha61o]에 [b:1fyha61o]ubuntu 13.04 (GNU/Linux 3.8.13-bone28 armv71)[/b:1fyha61o]을 [b:1fyha61o]eMMC[/b:1fyha61o]에 설치하였습니다.
설치 이미지는 ‘[b:1fyha61o]BBB-eMMC-flasher-ubuntu-13.04-2013-10-08.img[/b:1fyha61o]’ 입니다.

우선은 우분투 최소버전이다 보니, GUI를 사용할 수 없어 콘솔창에서 고정 IP를 아래와 같이 설정하였습니다.

[b:1fyha61o]$ sudo vi /etc/network/interfaces[/b:1fyha61o]


This file describes the network interfaces available on your system

and how to activate them. For more information, see interfaces(5).

The loopback network interface

[b:1fyha61o]auto lo
iface lo inet loopback[/b:1fyha61o]

The primary network interface

[b:1fyha61o]auto eth0
iface eth0 inet static[/b:1fyha61o]

Example to keep MAC address between reboots

#hwaddress ether DE:AD:BE:EF:CA:FE

WiFi Example

#auto wlan0
#iface wlan0 inet dhcp

wpa-ssid "essid"

wpa-psk "password"

Ethernet/RNDIS gadget (g_ether)

… or host side, usbnet and random hwaddr

Note on some boards, usb0 is automaticly setup with an init script

in that case, to completely disable remove file [run_boot-script] from the boot partition

iface usb0 int static

[b:1fyha61o] address 161.122.xxx.xxx —> 고정 IP
netmask 255.255.255.0 —> 서브넷 마스크
#netwrok 192.168.7.0
gateway 161.122.xxx.xxx —> 게이트 웨이

 dns-nameservers 161.122.xxx.xxx 134.75.xxx.xxx 8.8.8.8     ---> DNS 서버 주소[/b:1fyha61o]

그리고 네트워크를 아래와 같이 재시작 하였습니다.

[b:1fyha61o]$ sudo /etc/init.d/networking restart[/b:1fyha61o]

이렇게 재시작하니 resolv.conf 파일이 아래와 같이 수정되었습니다.

[b:1fyha61o]$ vi /etc/resolv.conf[/b:1fyha61o]


Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN

nameserver 161.122.xxx.xxx
nameserver 134.75.xxx.xxx
domain localdomain
search localdomain
nameserver 192.168.1.1

이렇게 상기와 같이 설정하여, IP ping

[b:1fyha61o]$ping 161.122.xxx.xxx[/b:1fyha61o]

그리고 게이트웨이 ping

[b:1fyha61o]$ping 161.122.xxx.xxx[/b:1fyha61o]

그리고 DNS 서버 ping

[b:1fyha61o]$ping 161.122.xxx.xxx[/b:1fyha61o]

까지는 확인이 되었는데, 구글 ping을 확인하니 접속이 안됩니다.

[b:1fyha61o]$ping google.co.kr [/b:1fyha61o]
[b:1fyha61o]ping google.co.kr (173.194.127.119) 56(84) bytes of data.
^C
— google.co.kr ping statistics —
42 packets transmitted, 0 received, 100% paket loss, time 40999ms[/b:1fyha61o]

혹시 제가 어딘가 잘못 설정한 부분이 있는지, 아니면 더 진행해야 할 사항이 있는지 궁금합니다.
아시는 분께서는 답변 부탁드립니다.

추가적으로 [b:1fyha61o]$dmesg | grep eth0[/b:1fyha61o] 로 확인하여 보니

[b:1fyha61o]IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready[/b:1fyha61o] 를 보아 랜모듈이 올라가지 않아
그렇다고 하는 질문/답변을 보았는데, 저의 경우는 플랫폼이 BeagleBone Black이고 최소한의 우분투 사양이
올라가서 그런지 답변 내용이 적용이 되지 않고 있습니다.

구글에서 ubuntu static ip settings 찾아봤습니다.

http://www.sudo-juice.com/how-to-set-a- ... roper-way/

등등 많이 나오네요. 도움이 되시길.

세벌님
도움 답변 주셔서 감사합니다.
올려주신 페이지에 대한 내용은 ubuntu 풀 버젼에 대한 내용 같습니다.
간단히 제 플랫폼에는 /etc/NetworkManager 란 디렉토리가 없습니다. ㅠ.ㅠ
다시 한 번 도움 주신점 감사합니다.

일단 랜 모듈의 문제는 아닙니다.
그 글타래의 정확한 에러 문구는 r8169: eth0: link down을 포함한 경우입니다.

설정을 보니 DNS 서버 돌려보려고 하시는거 같은데 맞나요?
아마 자체 설정하신 DNS 서버의 문제로 보입니다.

일단 ping 172.168… 같이 IP로 외부 사이트에 핑을 날려 보시고
이게 정상동작하면 DNS 서버의 문제
정상동작 안하면 네트워크 설정 문제로 보시면 될거 같네요.

traceroute를 사용해보세요.

gateway까지 ping이 되고 외부 호스트에 ping이 안되면 보통 gateway나 외부 호스트를 살펴봐야 합니다.

외부 호스트 테스트하기에는 8.8.8.8 구글 DNS가 좋습니다.

[quote="yemharc":2pxlsund]일단 랜 모듈의 문제는 아닙니다.
그 글타래의 정확한 에러 문구는 r8169: eth0: link down을 포함한 경우입니다.

설정을 보니 DNS 서버 돌려보려고 하시는거 같은데 맞나요?
아마 자체 설정하신 DNS 서버의 문제로 보입니다.

일단 ping 172.168… 같이 IP로 외부 사이트에 핑을 날려 보시고
이게 정상동작하면 DNS 서버의 문제
정상동작 안하면 네트워크 설정 문제로 보시면 될거 같네요.[/quote:2pxlsund]

yemharc님 안녕하세요.

저는 DNS 서버를 돌리려고 하지는 않고,
BBB에 Real-Time framework을 올리려고 합니다.
하여 단순히 웹에서 프로그램 정도 다운을 받으려 네트워크 연결을 하려합니다.

일단 외부 사이트로 핑을 날려 보아도 응답이 없는 것으로 보아
무언가 다른 문제가 있는 듯 합니다.

[b:2pxlsund]$ping 173.194.127.63
ping google.co.kr (173.194.127.63) 56(84) bytes of data.
^C
— google.co.kr ping statistics —
42 packets transmitted, 0 received, 100% paket loss, time 4008ms[/b:2pxlsund]

cheon798님,

ihavnoth님이 말씀하신바대로
게이트웨이(외부로 통하는 관문)까지의
연결성공 여부를 테스트
해보시는게 무엇보다 먼저 살펴야할
절차인줄로 아뢰옵니다.

파일 첨부합니다.

[quote="황병희":3ipjio79]cheon798님,

ihavnoth님이 말씀하신바대로
게이트웨이(외부로 통하는 관문)까지의
연결성공 여부를 테스트
해보시는게 무엇보다 먼저 살펴야할
절차인줄로 아뢰옵니다.

파일 첨부합니다.[/quote:3ipjio79]

황병희님, ihaynoth님

게이트웨이까지 연결은 되는것 같습니다. :D
도움 주셔서 감사합니다.

먼저 dhcp로 붙여서 인터넷 연결이 정상적으로 되는지 확인합니다.

[code:2ue9fszx]
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

$ sudo /etc/init.d/networking restart

$ netstat -rn

Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.28.2 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.28.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

$ ping google.co.kr
[/code:2ue9fszx]

출력되는 gateway를 가지고 static ip를 다시 구성합니다.

[code:2ue9fszx]
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.28.138
netmask 255.255.255.0
gateway 192.168.28.2

/etc/resolv.conf 를 수정합니다.

nameserver 168.126.63.1 <- 원하는 DNS 서버 설정

$ sudo /etc/init.d/networking restart
$ ping 192.168.28.2
$ ping google.co.kr
[/code:2ue9fszx]

[quote="yemharc":14tekccd]먼저 dhcp로 붙여서 인터넷 연결이 정상적으로 되는지 확인합니다.

[code:14tekccd]
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

$ sudo /etc/init.d/networking restart

$ netstat -rn

Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.28.2 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.28.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

$ ping google.co.kr
[/code:14tekccd]

출력되는 gateway를 가지고 static ip를 다시 구성합니다.

[code:14tekccd]
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.28.138
netmask 255.255.255.0
gateway 192.168.28.2

/etc/resolv.conf 를 수정합니다.

nameserver 168.126.63.1 <- 원하는 DNS 서버 설정

$ sudo /etc/init.d/networking restart
$ ping 192.168.28.2
$ ping google.co.kr
[/code:14tekccd][/quote:14tekccd]

yemharc님 안녕하세요.

우선 몇번에 걸쳐 친절한 답변에 진심으로 감사드립니다.
현재 회사에서는 고정아이피를 사용하고 있어, 아무래도 보안인듯 하여
집에 연결된 랜선으로 dhcp로 연결해 보았는데, 네트워크 연결이 잘 됩니다.

그래서 회사 정보통신팀으로 다시 전화를 해 물어보니(전에도 몇번 전화해서 물어보았으나 이상없다는 답변으로 좌절~! :cry: )
(아이피 ping도 되고, DNS ping도 되고, gateway ping도 되고,
내부 다른 아이피랑도 ping이 뜨는데 안되는 이유가 뭐냐고 따져묻자)
정보통신팀에서 ping을 막고 있었다고 합니다.

yemharc님을 비롯하여 도움 주신 ihynoth님 황병희님께 죄송하기가 이를데 없습니다. :oops:
덕분에 많은 도움이 되었고, 더불어 앞으로도 잘 부탁드리겠습니다.
항상 건강에 유의하시고 수고하십시요.