ubuntu 7.10 gusty 安裝 dhcp-server

Posted on 29 二月, 2008. Filed under: Linux | 標籤:, , , , , |

網路環境

eth0 : 對外網卡使用固定ip

eth1 : 對內網卡使用class c ip : 192.168.1.1

安裝dhcp server

# aptitude install dhcp-server

修改interfaces設定

# vim /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 140.118.x.x
netmask 255.255.255.0
gateway 140.118.202.254

auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0

重開網路

# /etc/init.d/networking restart

修改 dhcpd 設定

# vim /etc/dhcp3/dhcpd.conf

subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 140.118.2.53;
option ip-forwarding off;
range dynamic-bootp 192.168.1.100 192.168.1.200;
default-lease-time 21600;
max-lease-time 43200;
}

重開dhcpd

# /etc/init.d/dhcp3-server restart

到這一步,區域網路內的電腦已經可以抓到ip了(範圍是192.168.1.100 ~ 192.168.1.200)

設定NAT

滿麻煩的,乾脆用firestarter

# aptitude install firestarter

打開之後把外部網路設定成eth0, 外部設定成eth1

把網路分享打開,設定檔照著上面填,讓firestarter把原本的設定覆蓋過去

應該就可以了

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...