태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

'인터넷설정'에 해당되는 글 1건

  1. 2009/12/09 [Beagle board] OTG usb를 이용한 인터넷 설정 (host와의 NAT 설정)

크리에이티브 커먼즈 라이선스
Creative Commons License



[호스트 준비]

참고 사이트: http://ubuntuforums.org/showthread.php?p=6060607

-. 인터넷에 연결된 실제 이더넷 카드: eth0
-. 보드랑 연결된 인터페이스: eth1

* 아래 방법대로 설정을 할 경우 보안상 문제가 생길 수 있으니 주의.

(인터페이스 번호는 환경마다 다를 수 있으니 자신꺼에 해당하는걸로 하면 됩니당)


-. /etc/network/interface 수정

auto eth0
iface eth0 inet dhcp
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
   address 192.168.10.1        
   netmask 255.255.255.0        
   broadcast 192.168.10.0        
   network 192.168.10.0


-. /etc/sysctl.conf 수정 ( 해당 부분 찾아서 주석 제거, 없으면 추가하면 됨)
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1
net.ipv4.ip_forward=1


-. /etc/rc.local 수정
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE


-. 수정된 내용 적용 

sudo ifconfig eth1 192.168.10.1
sudo sysctl -w net.ipv4.ip_forward=1    (제대로 적용이 안되면 재부팅 하면 됨=_=;;;)
sudo iptables -P FORWARD ACCEPT
sudo iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE






[보드 준비]

-. 호스트랑 연결된 인터페이스: usb0
-. 보드 IP: 192.168.10.184

-. 라우팅 설정
route add default gw 192.168.10.1


-. 설정 확인
라우팅 설정이 제대로 되었다면 route를 실행 했을 때


Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.10.0    *               255.255.255.0   U     0      0        0 usb0
default         192.168.10.1    0.0.0.0         UG    0      0        0 usb0

이런식으로 나와야 함.....




저작자 표시 비영리 변경 금지
Posted by morcavon
이전버튼 1 이전버튼