일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 동부로봇
- Marsboard
- emIDE
- fdisk
- Cortex-M3
- 마스보드
- ubuntu
- DRS-0101
- 갈릴레오
- Boyue
- Z435
- QT
- U-boot
- STM32F10x
- usb부팅
- Python
- openocd
- ares note
- galileo
- 우분투
- pyside6
- ICbanq
- 허큘렉스
- lg smart recovery
- ft2232
- HerkuleX
- CMSIS
- JTAG
- Galileo Gen2
- smartrobot board
- Today
- Total
Life Seed
ubuntu를 IP 공유기로 사용하자 (isc_dhcp_server 설치 및 설정) 본문
- http://crowz.kr/index.php?category=1477&mid=Linux&document_srl=504
- htp://gabrielkim.tistory.com/33
System :: Ubuntu 12.04 64Bits , Ethernet Card 2 Ea (eth0, eth1)
- 공유기 Hub로 사용되는 port :: eth1
1. Network 설정
$ 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.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
network 192.168.0.0
$ sudo /etc/init.d/networking restart
cf) host file을 수정하면 host 명으로 접속가능하다.
$ sudo vi /etc/hosts
127.0.0.1 localhost
192.168.0.1 ubunturouter
2. 마스커 레이딩 활성화
$ 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
3. dhcp 서버 설치
$ sudo apt-get install isc-dhcp-server
설정)
$ sudo vi /etc/dhcp/dhcpd.conf
ddns-update-style none;
option domain-name "ubunturouter";
option domain-name-servers 156.147.1.1, 156.147.135.180; # eth0의 dns 서버 입력
default-lease-time 3600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option subnet-mask 255.255.255.0;
option broadcast-address 255.255.255.0;
option routers 192.168.0.1;
}
$ sudo vi /etc/default/isc-dhcp-server
INTERFACES="eth1"
$ sudo service isc-dhcp-server restart
cf) arp -n 명령을 이용하면 현재 접속중인 IP 들을 확인 할 수 있다.