- 配置静态IP
网卡配置文件路径:/etc/sysconfig/network-scripts/ifcfg-${eth-name}
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
#BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=6e159a82-510e-45f1-bd6c-18e1e33224d0
DEVICE=enp0s3
ONBOOT=yes #开机启动
IPV6_PRIVACY=no
NM_CONTROLLED=no #表示该接口将通过该配置文件进行设置,而不是通过网络管理器进行管理
BOOTPROTO=static #静态IP
IPADDR=10.0.2.76 #本机地址
NETMASK=255.255.255.0 #子网掩码
GATEWAY=10.0.2.1 #默认网关
HWADDR=08:00:27:2B:23:7C #MAC地址
基本网络配置路径:/etc/sysconfig/network
NETWORKING=yes #设置网络是否有效
GATEWAY=10.0.2.1 #默认网关
DNS1=114.114.114.114 #DNS服务地址
DNS2=8.8.8.8 #DNS服务地址
重新启动网络
service network restart
- 关闭防火墙
systemctl stop firewalld
systemctl disabled firewalld
systemctl list-unit-files|grep firewalld
- 关闭selinux
selinux配置文件路径:/etc/selinux/config(需要重启生效) - 使用阿里yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
- 安装cobbler及相关程序
yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd xinet
systemctl start httpd.service
systemctl enable httpd.service
systemctl start cobblerd.service
systemctl enable cobblerd.service
- cobbler配置
sed -i 's/server: 127.0.0.1/server: 10.0.2.76/' /etc/cobbler/settings
sed -i 's/next_server: 127.0.0.1/next_server: 10.0.2.76/' /etc/cobbler/settings
sed -i 's#yes#no#' /etc/xinetd.d/tftp
cobbler get-loaders
systemctl start rsyncd.service
systemctl enable rsyncd.service
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings
sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt 'oldboy' 'Test13579!'`\"#" /etc/cobbler/settings
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings
sed -i.ori 's#192.168.1#10.0.2#g;22d;23d' /etc/cobbler/dhcp.template
systemctl restart cobblerd
cobbler sync
systemctl restart xinetd
cobbler check
- 解决cobbler web访问500错误
yum -y install python2-pip
pip install Django==1.8.9
网友评论