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월 29일 화요일

우분투 shell script 사용 및 부팅 시 자동으로 실행

ubuntu 10.04

1) prepare shell script file to ipforward
gedit netshare.sh

2) write next scripts in the netshare.sh

#! /bin/bash          
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

/etc/init.d/networking restart

3) setting to use at the booting
3-1) copy the file to /etc/init.d
cp netshare.sh /etc/init.d/netshare.h

3-2) set permission
chmod +x netshare.sh

3-3) update shell scripts
update-rc.d netshare.sh defaults

댓글 없음:

댓글 쓰기

twitter leegse