'2010/09'에 해당되는 글 2건

  1. 리눅스 인터넷 공유(Masquerade) 2010/09/08
  2. [Ubuntu] 무선랜 설정 시 볼 만한 문서 2010/09/03
http://www.otl.ne.kr/243

문서 중 가장 간단하다.

문서를 정리하자면,

다음과 같은 외부와 연결시키고 싶은 네트워크가 있다고 하자.

   _____________
  /                     \               외부 IP               _________              내부 IP
 |   Internet          |           123.12.23.43           |  linux     |          192.168.0.1
 |   google.com    | ------[외부 랜카드]------| machine |------[내부 랜카드]
  \_____________/                                         ----------             |
                                                                                               |        
                                                                                               |
                                                   _____________                ______|_______
                                                  | 192.168.0.2  |             /                      |
                                                  |    내부        |--------|    192.168.0.0    |
                                                  |    컴퓨터     |            |      인트라넷      |
                                                  --------------             \______________/ 

외부 네트워크 카드는 eth0, 외부 IP는 123.12.23.43, 그리고 내부 네크워크 카드는 eth1라고 가정하자.

$> modprobe ipt_MASQUERADE # 만약 실패하더라도 다음을 계속하시오.
$> iptables -F; iptables -t nat -F; iptables -t mangle -F
$> iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 123.12.23.43
$> echo 1 > /proc/sys/net/ipv4/ip_forward

그리고 보안을 위해:

$> iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$> iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
$> iptables -P INPUT DROP # 위의 두 줄이 성공한 경우에만
$> iptables -A FORWARD -i eth0 -o eth0 -j REJECT

이 문서는 GNU Free Documentation License를 따른다.

http://www.gnu.org/copyleft/fdl.html

웬만한건 드라이버 잡으면

$ sudo iwconfig wlan0 essid GoogleGuest
$ sudo dhclient wlan0

하면 된다.

켰을 때 자동으로 연결 안하길래 아래와 같이 추가해 줬다.
/etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
        wireless_essid GoogleGuest

 

https://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide