참고 사이트: 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
이런식으로 나와야 함.....
'Workspace > Embedded' 카테고리의 다른 글
| [Beagle board] OTG usb를 이용한 인터넷 설정 (host와의 NAT 설정) (0) | 2009/12/09 |
|---|---|
| [Beagle board] 출력 화면 해상도 변경하기... (0) | 2009/12/09 |