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就不能使用了
你先查阅一下系统日志,找到相应的事件代码,便于解答参考.