网络安装ubuntu
来源:互联网 发布:工业企业数据库2014 编辑:程序博客网 时间:2024/05/22 13:15
网络安装操作系统需要以下环境支持:
1、 可以从网络启动的网卡,支持 PXE(Pre-boot Execution Environment)
2、 Dhcp服务:用来给客户机分配IP地址
3、 Tftp服务:用来下载操作系统安装程序的引导程序,它依赖xinetd
4、 http服务或者ftp服务:用来为客户端提供操作系统文件
网络安装操作系统原理:
客户端开机,由网卡从网络上DHCP服务器上得到IP地址。
通过网络安装Linux系统
=======================================================
Clinet
1、 加载光盘
mount /dev/sd3 /media
mount 光盘镜像文件
# mkdir -p /media/owlinux36
# mount -t iso9660 /root/OWLinux-3.6-U1.iso /media/owlinux36 -o loop
验证是否成功# cd /media/owlinux36 && ls
2、 DHCP服务配置:
sudo apt-get install isc-dhcp-server
vim
#改为对应网卡 ,只响应此网卡上的 dhcp 请求
INTERFACES="eth0"
sudo vi /etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
#allow boot from network use PXE
allow booting;
allow bootp;
subnet192.168.95.0netmask255.255.255.0{
#--- default gateway
option routers192.168.95.1;
option subnet-mask255.255.255.0;
option nis-domain"alrise.org";
option domain-name"alrise.org";
option domain-name-servers192.168.95.1;
option time-offset -18000;#Eastern Standard Time
#option ntp-servers 192.168.1.1;
#option netbios-name-servers 192.168.1.1;
#--- Selects point-to-point node (default is hybrid). Don't change this unless
#-- you understand Netbios very well
#option netbios-node-type 2;
range dynamic-bootp192.168.95.192 192.168.95.254;
default-lease-time 21600;
max-lease-time 43200;
#next-server is the tftp server.
#filename is boot image file under tftp root
next-server 192.168.95.1;
filename "pxelinux.0";
#we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
启动:
sudo service isc-dhcp-server restart
3、 TFTP服务器配置:
apt-get install xinetd
apt-get install tftp tftpd
tftpd是服务器端程序;tftp是客户端程序
1.安装tftpd:
$ sudo apt-get install xinetd tftpd tftp
2.用xinetd程序启动:
创建/etc/xinetd.d/tftp,并添加如下内容:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /media/install/netboot #ubuntu操作系统光盘提供的从网络安装的启动引导程序位置
disable = no
}
3./media/install/netboot 是前面挂载的光盘文件,这个netboot是操作系统提供的从网络安装的启动引导程序。
4.
$ sudo service xinetd start
1.设置文件可读权限。如果也设置过了,就不用设置了。
$ sudo chmod -R +r/media/install/netboot
$ sudo chown -R nobody/media/install/netboot
备注:
上面的实现方法在ubuntu12中没有走通。安装tftp-hpa后,就启动了下面服务。
/usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /var/lib/tftpboot
/var/lib/tftpboot:为默认的路径,所以需要把网络引导程序复制到它下面:
cp -R /media/install/netboot/* /var/lib/tftpboot
验证:
root@a:/home# tftp 127.0.0.1
tftp> get pxelinux.0
tftp> q
root@a:/home# ls -l
总用量 28
-rw-r--r-- 1 root root 26461 10月 27 19:49 pxelinux.0
4、 HTTP服务器配置:
apt-get install apach2
配置配置文件httpd.conf:
Alias /ubuntu /media
<Directory "/media">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/trunk/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
重启httpd服务
apachctl restart
用浏览器访问http://127.0.0.1/ubuntu/md5sum.txt
参考:
http://blog.csdn.net/huzhenwei/article/details/3447866
- Ubuntu 网络安装方法
- 网络安装ubuntu
- 网络安装ubuntu
- ubuntu配置网络安装
- ubuntu安装网络打印机
- 网络安装ubuntu
- ubuntu 8.04安装网络配置
- Ubuntu NFS网络文件系统安装
- ubuntu server 网络设置和软件安装
- Ubuntu下安装网络电视sopcast
- 网络安装Ubuntu - step by step
- ubuntu 9.10 ppstream 网络电视安装
- Ubuntu下配置网络,安装mysql,jdk
- Ubuntu下安装wicd网络管理工具
- Ubuntu 安装sopcast-player看网络电视
- ubuntu-10.04.1-server-64网络安装
- 如何网络和硬盘安装Ubuntu系统
- Win7 VMware安装ubuntu网络配置联网
- hdu1102 Constructing Roads 最小生成树+prim
- 初始化过程
- 加权编辑距离
- 二进制、八进制、十进制、十六进制之间的转换
- MyEclipse中文乱码,编码格式设置,文件编码格式
- 网络安装ubuntu
- 例题3-4
- 关于输入流状态函数cin.eof()的问题
- 杨辉三角
- List of USB ID's(2012-09-20), PCI Vendors and Devices(2012-11-13)
- c++调用C#
- cout.setf()是用来设志位的,cout.precision()是用来设置精度的
- Mybatis 高级结果映射 ResultMap Association Collection
- 有关多重继承虚基类的问题