dhcp 配置

DHCP配置 

 

1,/etc/dhcpd.conf/etc/dhcp/dhcpd.conf

 

ddns-update-styleinterim;

ignoreclient-updates;

subnet 10.10.10.0netmask 255.255.255.0 {

# --- default gateway

        option routers                  10.10.10.1;

        option subnet-mask              255.255.255.0;

#       option netbios-node-type 2;

        option domain-name-servers 172.16.31.1;

        range dynamic-bootp 10.10.10.10010.10.10.110;

        default-lease-time 21600;

        max-lease-time 43200;

        # we want the nameserver to appear at afixed address

}

2,/etc/sysconfig/dhcpd

# Command lineoptions here

DHCPDARGS=eth1 #用於DHCP的網卡接口

user=root

group=root

3,iptables –t filter–F

  Iptables –t nat –F

4,iptables –t nat –L–n

iptables -t nat -IPOSTROUTING -s 10.10.10.0/24 -j SNAT --to 172.16.31.6

POSTROUTING鏈中做源地址轉換

5,/etc/sysctl.conf

net.ipv4.ip_forward= 1

6,保存配置

/etc/rc.d/init.d/iptablessave

Iptables-save >iptables.bak

Iptables-restore<iptables.bak


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章