- 시스템 환경구성
- Vmware 머신 두개이상(여기서는 두대로 한다.)
- VMWare network 구성
- VMNet8 : NAT - dhcp활성화
- VMNet2 : host-only -dhcp비활성화 (subnet 10.10.10.0/24)
- 가상머신 구성
- 마스커레이드를 사용할 시스템
- NAT - dhcp로 ip 가져온다.
- VMnet2 : 10.10.10.10/24 (게이트웨이 설정 안함)
- DHCP : Dynamic Host Configuration Protocol
1) rpm -qa | grep dhcp
2) yum install -y dhcp
3)vi /etc/dhcpd.conf
4)vi에서
:r /usr/share/doc/dhcp*/dhcpd.conf.sample
ddns-update-style interim; ignore client-updates;
subnet 10.10.10.0 netmask 255.255.255.0 {
# --- default gateway option routers 10.10.10.10; option subnet-mask 255.255.255.0;
# option nis-domain "domain.org"; option domain-name "itwithgod.lux"; # option domain-name-servers 192.168.1.1; # option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don't change this unless # -- you understand Netbios very well # option netbios-node-type 2;
range dynamic-bootp 10.10.10.100 10.10.10.254; default-lease-time 21600; max-lease-time 43200;
# we want the nameserver to appear at a fixed address # host ns { # next-server marvin.redhat.com; # hardware ethernet 12:34:56:78:AB:CD; # fixed-address 207.175.42.254; # } } # ========================================================= 세부설명 ========================================================= ddns-update-style interim; |
3. DHCP 아이피 임대로그파일 지켜보기
# tail -f /var/lib/dhcpd/dhcpd.leases
4. 방화벽 설정 (udp /67, 68)
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 67:68 -j ACCEPT |
5. DHCP 데몬 재시작
# service dhcpd restart
6. 클라이언트 설정
1) cat /etc/sysconfig/network-scripts/ifcfg-eth0 에 아래와 같이 되어 있으면 된다.
HWADDR 값은 시스템 마다 고유하므로 아래와 같이 않을 것이다.
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=00:0c:29:49:c0:c7
2)service network restart