Title20110603


Main Programming Languages
ASP.NET C# Fortran Matlab
Ph.D
Major News CFD
OS
ubuntu windows IPAD
Review

[0] Vortex Sound
[1] Sound and Source of Sound
[2] Back-Scattering correction and further extensions of Amiets TE noise model Part 1: theory

Life
[0] 잡담 [1] 사진

이 블로그 검색

2011년 3월 11일 금요일

ubuntu에서 인터넷 공유


출처: http://blog.naver.com/PostView.nhn?blogId=kim0427k&logNo=30074443031&viewDate=&currentPage=1&listtype=0

1) 아래를 터미널에서 입력한다.


# echo "1"> /proc/sys/net/ipv4/ip_forward
# iptables -P FORWARD DROP
# iptables -A FORWARD -o eth0 -j ACCEPT
# iptables -A FORWARD -o eth1 -j ACCEPT
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# ifconfig eth1 192.168.0.1 up


2) 이때 ethernet setting을 위해 다음을 입력하여  interfaces를 연다.

# sudo gedit /etc/network/interfaces


3) interfaces에 다음 내용을 입력.

#===============================
#The loopback network interface
auto lo
iface lo inet loopback

#The primary network interface
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask 255.255.255.0
gateway xxx.xxx.xxx.xxx
dns-nameservers xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx
 
#The secondary network interface for ipforwarding
#auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
#iface eth1 inet dhcp

#=================================


4) 이 후 네트워크를 재시작...


# /etc/init.d/networking restart


댓글 없음:

댓글 쓰기

twitter leegse