linux下安裝配置DHCP伺服器

2021-09-08 10:53:42 字數 4912 閱讀 9078

前提是已經安裝了 core 及 base 兩個組

1

2

3

4

5

# cat /etc/redhat-release

red hat enterprise linux server release 6.4 (santiago)

# uname -a

linux localhost.localdomain 2.6.32-358.el6.x86_64#1 smp tue jan 29

11:47:41 est 2013 x86_64 x86_64 x86_64 gnu/linux

修改本機ip為靜態獲取

1

2

3

4

5

6

7

8

9

10

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

device=eth0

type=ethernet

onboot=yes

nm_controlled=yes

bootproto=static

ipaddr=192.168.101.11

netmask=255.255.255.0

gateway=192.168.101.1

# service network restart

關閉 selinux

1

2

3

4

5

6

7

8

9

10

11

12

# vi /etc/sysconfig/selinux

# this file controls the state of selinux on the system.

# selinux= can take one of these three values:

#     enforcing - selinux security policy is enforced.

#     permissive - selinux prints warnings instead of enforcing.

#     disabled - no selinux policy is loaded.

#selinux=enforcing

selinux=disabled

# selinuxtype= can take one of these two values:

#     targeted - targeted processes are protected,

#     mls - multi level security protection.

selinuxtype=targeted

安裝伺服器元件

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

# mkdir /mnt/cdrom

# mount /dev/cdrom /mnt/cdrom/

mount: block device/dev/sr0is write-protected, mountingread-only

# cd /mnt/cdrom/packages/

# ls dhcp*

dhcp-4.1.1-34.p1.el6.x86_64.rpm

dhcp-common-4.1.1-34.p1.el6.x86_64.rpm

#安裝 dhcp 軟體包

# rpm -uvh dhcp-4.1.1-34.p1.el6.x86_64.rpm

error: failed dependencies:

portreserve is needed by dhcp-12:4.1.1-34.p1.el6.x86_64

#解決包的依賴性

# rpm -uvh dhcp-4.1.1-34.p1.el6.x86_64.rpm \

portreserve-0.0.4-9.el6.x86_64.rpm

preparing...########################### [100%]

1:portreserve########################### [ 50%]

2:dhcp########################### [100%]

更改配置檔案

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

# cat dhcpd.conf

option domain-name"bigcloud.local";#此處設定主機名

option domain-name-servers 192.168.188.11, 192.168.188.12;#此處設定預設dns

subnet 192.168.188.0  netmask 255.255.255.0

subnet 192.168.189.0  netmask 255.255.255.0

host pc1 {#為某一台主機單獨配置靜態ip

hardware ethernet 00:12:34:56:78:90;

fixed-address 192.168.188.111;

#啟動服務。

# service dhcpd start

starting dhcpd:                                            [  ok  ]

本文出自 「李豪」 部落格,請務必保留此出處

如何在CentOS 8上安裝配置DHCP伺服器

在本教程中,我們將向您展示如何在centos 8上設定dhcp伺服器。步驟1.首先,讓我們首先確保您的系統是最新的。sudo dnf clean all sudo dnf update 步驟2.在centos 8上安裝dhcp伺服器。使用以下命令安裝dhcp軟體包 sudo dnf install ...

linux下安裝配置軟體

1.fedora下的軟體配置安裝 1.1 tar zxvf tar.gz 命令解壓縮檔案並提取歸檔檔案 其中引數z是呼叫gzip d來解壓 x是從歸檔檔案中提取檔案。rpm ivh rpm包命令安裝rpm二進位製包軟體 列 rpm ivh soft.rpm rpm e soft 解除安裝 rpm u...

Linux下安裝 配置ACE

url 二 安裝前的配置 配置環境變數 vi etc profile 增加如下的內容 export ace root ld libary path ace root ace ld library path export ld library path source etc profile 三 開始安...