導航:首頁 > IDC知識 > centos7dhcp伺服器

centos7dhcp伺服器

發布時間:2020-12-09 03:45:40

1、centos7.3 dhcp是不是換成dnsmasq

請問搭建dhcp伺服器進行公司上網服務,請問客戶端是否要進行設置呢,比如到伺服器的什麼域的管理,還是只要伺服器進行dhcp,客戶端自動就可以上網了呢

2、VMware搭建虛擬機centos7.4版本的,如何配置DHCP

centos伺服器配置dhcp服務還是挺簡單的。修改配置文件,重啟服務就可以了。

3、centos7 下我獲取不到DHCP的IPv4,但是有IPv6的地址。

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
ONBOOT=no 改為ONBOOT=yes

systemctl restart network.service
ip addr show

4、使用VMware安裝的centos 7 使用DHCP模式可以上網,使用static模式不能上網

ping 172的地址能通,但ping外網域名不通的話,說明你DNS沒設

5、centos7 搭建dhcp時,如何綁定一塊網卡?

是isc dhcpd吧,就直接命令行指定介面就行回了。
/path/to/dhcpd eth0

dhcpd [ -p port ] [ -f ] [ -d ] [ -q ] [ -t |答 -T ] [ -cf config-file ] [ -lf lease-file ] [ -tf trace-output-file ] [ -play trace-playback-file ] [ if0 [ ...ifN ] ]

6、centos7 2t以上的硬碟怎麼寫自動安裝kickstart

方法/步驟
1
PXE(preboot execute environment,預啟動執行環境)是由Intel公司開發的最新技術,工作於Client/Server的網路模式,支持工作站通過網路從遠端伺服器下載映像,並由此支持通過網路啟動操作系統,在啟動過程中,終端要求伺服器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)協議下載一個啟動軟體包到本機內存中執行。
2
伺服器或者電腦都支持PXE啟動(從網卡啟動),在BIOS上默認是有安裝DHCP客戶端和tftp客戶端,所以可以利用這個來實現網路自動化安裝。 從網卡啟動,dhcp獲取到IP,然後tftp去傳遞linux的內核,並啟動內核。內核啟動就會去載入ks文件,我們只要把安裝的內容寫入ks文件中就可以了。(其中ks文件中會有掛載nfs共享的RHEL/Centos安裝所需的包)
3
安裝dhcp服務:
yum -y install dhcp
如下圖:

4
配置dhcp服務:
cd /etc/dhcp/
vim dhcpd.conf

ddns-update-style none;
#固定格式
subnet 192.168.122.0 netmask 255.255.255.0 {
#定義dhcp應用的網路
option routers 192.168.122.90;
#設置路由
option subnet-mask 255.255.255.0;
#設置掩碼
option domain-name "example.com";
#設置所屬的域
option domain-name-servers 192.168.122.11;
#設置名字伺服器的IP,如果沒有名字伺服器推出來的主機名跟預期的不一樣
pool {
range 192.168.122.12 192.168.122.89;
}
#設置地址池,可以設置多個地址池
filename "/pxelinux.0";
#設置文件共享
next-server 192.168.122.11;
#設置共享的伺服器
host centos6_1 {
hardware ethernet 52:54:00:e4:da:aa;
fixed-address 192.168.122.12;
}

}
#IP與MAC綁定,這個事先要知道MAC,不知道IP就會隨機分配

如下圖:

5
service dhcpd start #啟動dhcp服務tail -f /var/log/messages #跟蹤日誌,查看是否報錯
netstat -lntup | grep 67 #查看埠是否啟動
6
安裝tftp-server:
yum -y install tftp-server
tftp在centos6是依賴於xinetd服務的,所以使用yum安裝,依賴會被自動安裝
如下圖:

7
配置tftp服務:
vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

8
設置tftp的共享配置文件:
cd /var/lib/tftpboot/
mkdir pxelinux.cfg
cd pxelinux.cfg
vim default

default linux
prompt 0
timeout 2
label linux
kernel vmlinuz
append ksdevice=eth0 load_ramdisk=1 initrd=initrd.img network ks=http://192.168.122.11/kickstart.cfg

9
啟動xinetd服務,就啟動了tftp服務
service xinetd start
netstat -lntpd | grep 69 #查看埠是否啟動

需要下載pxelinux.0放在/var/lib/tftpboot/的目錄下,或者安裝syslinux,也會有這個文件的

yum -y install syslinux
安裝完,文件路徑是:/usr/share/syslinux/pxelinux.0

將光碟裡面的ioslinux目錄下的vmlinuz和initrd.img復制到/var/lib/tftpboot/
確定這個目錄的所有文件都有讀執行的許可權就可以了
service rpcbind restart #重啟埠映射服務service xinetd restart #重啟xinetd服務
10
安裝httpd服務:
yum -y groupinstall "Web Server" #終端顯示語言是英文
或者
yum -y groupinstall "萬維網伺服器" #終端顯示語言是中文

啟動服務:service httpd start

11
安裝nfs:
yum -y install nfs-utils

vim /etc/exports
/var/ftp/pub 192.168.122.0/24(ro,sync,no_root_squash)

啟動服務:
service rpcbind restart #重啟埠映射服務
service nfs start

12
kickstart的文件可以手動寫,也可以使用system-config-kickstart命令來生成,需要安裝system-config-kickstart.noarch這個包。
system-config-kickstart
最後保存的文件可以復制到/var/www/html/下 workstartion.cfg

text
install
keyboard us
lang en_US
selinux --enforcing
#langsupport --default en_US en_US
network --bootproto dhcp
nfs --server=192.168.122.11 --dir=/var/ftp/pub

# Partition 19028M
%include /tmp/partitioning

#mouse genericps/2 --emulthree
#mouse generic3ps/2
#mouse genericwheelusb --device input/mice
timezone Asia/Shanghai --utc
#timezone US/Central --utc
#timezone US/Mountain --utc
#timezone US/Pacific --utc

graphical
#skipx
rootpw centos
auth --useshadow --passalgo=md5
firstboot --disable
firewall --disabled
bootloader --location=mbr
reboot

%packages

@basic-desktop
@desktop-debugging
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@legacy-x
@remote-desktop-clients
@x11
# KDE is huge...install it if you wish
#@ KDE
#@ Windows File Server
#@ Web Server
elinks
openssh
openssh-server
openssh-clients
vim-enhanced
samba-common
samba-client
gimp
gimp-data-extras
enscript
libcap
ntp
coreutils
elfutils
elfutils-libelfs
gimp-print-plugin
gnome-icon-theme
gstreamer
gstreamer-tools
#libgnomeprint22
#libgnomeprintui22
libgsf
libIDL
libraw1394
nautilus-cd-burner
openmotif
pyorbit
startup-notification
ttmkfdir
firefox
mutt
vnc
gcc

%post

# Set the time, then set the hardware clock
ntpdate -b 192.168.122.254
hwclock --systohc --utc
# Non-destructive rebuild approach
CURRENT="5"
if [ -x /usr/bin/links ]; then httpget="/usr/bin/links";
elif [ -x /usr/bin/lyn

7、我在虛擬機上得centos7上配置了多網卡 然後dhcp就不能使用了

你先查閱一下系統日誌,找到相應的事件代碼,便於解答參考.

與centos7dhcp伺服器相關的知識