티스토리 뷰
Source : http://jun2zenith.tistory.com/32
우분투 서버 10.04에서 테스트 하였음
현재 네트워크 구성
외부 네트워크 - 100 메가비트 내장랜, 192.168.123.102, eth0
내부 네트워크1 - 1기가비트 외장랜 , 192.168.1.2, eth1
내부 네트워크2 - 1기가비트 외장랜, 192.168.2.2, eht2
랜 두개에 무선 공유기하나랑 내 컴퓨터 하나랑 두개 연결하려고 함
만약 랜카드 하나만 연결하려면 eth2에 관한 내용은 삭제
먼저 네트워크 인터페이스 설정
sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
auto eth2
iface eth2 inet static
address 192.168.2.2
netmask 255.255.255.0
broadcast 192.168.2.255
network 192.168.2.0
hosts설정
sudo vi /etc/hosts
127.0.0.1 localhost
192.168.1.2 Server_network_1
192.168.2.2 Server_network_2
DHCP 설치
sudo apt-get install dhcp3-server
sudo vi /etc/dhcp3/dhcpd.conf
ddns-update-style none;
option domain-name-servers 61.41.153.2, 203.248.252.2;
default-lease-time 42300;
max-lease-time 84600;
authoritative;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-name " Server_network_1 ";
option routers 192.168.1.2;
range 192.168.1.100 192.168.1.101;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
option domain-name " Server_network_2 ";
option routers 192.168.2.2;
range 192.168.2.100 192.168.2.101;
}
sudo vi /etc/default/dhcp3-server
INTERFACES="eth1 eht2"
IP forwarding 설정
sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1 # 주석삭제
sudo vi /etc/rc.local
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE
여기서 eth0 는 외부 네트워크 렌카드 이름 을 적용하면 됨.
DHCP서버 시작
sudo /etc/init.d/dhcp3-server start
혹시 안된다면 재부팅 하면됨. 혹은 network 재설정
도움을 주신 분들
http://blog.naver.com/PostView.nhn?blogId=eleexpert&logNo=140117053249
http://goo.gl/QxgId
http://goo.gl/70bm1
'Application > Linux' 카테고리의 다른 글
그림파일 리사이즈 (0) | 2015.08.28 |
---|---|
디렉토리 돌아다니면서 특정 파일 삭제 (0) | 2015.08.24 |
wget (0) | 2014.11.01 |
deb 파일 만들기 (0) | 2014.10.29 |
bind 설정을 할 때 어디서 에러가 났는지 보고싶을 경우 (0) | 2014.09.30 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- diary
- 프리랜서로 살아남는 법
- Linux
- cartoon
- Life News
- Embedded System
- Tech News
- humor
- 막장로그
- 야마꼬툰
- Network Inspector
- Mabinogi
- 나비효과
- Web Programming
- Assembly
- USB Lecture
- BadCode
- Reverse Engineering
- C#
- Military
- 짤방 및 아이콘
- network
- console
- medical
- Battle
- Information Processor
- 3D Engine
- wallpaper
- WDB
- win32
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함