特殊:Badtitle/NS100:Installation/QuickNetboot:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第7行: | 第7行: | ||
== DHCP/TFTP server installation == | == DHCP/TFTP server installation == | ||
=== Prepare === | === Prepare === | ||
0 become the root | |||
<pre><nowiki> | |||
sudo su - | |||
</nowiki></pre> | |||
<ol><li>install required software</li></ol> | <ol><li>install required software</li></ol> | ||
<pre><nowiki> | <pre><nowiki> | ||
apt-get install dnsmasq atftp atftpd | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#2 download and unpack the netboot tarball | 1.#2 download and unpack the netboot tarball | ||
<pre><nowiki> | <pre><nowiki> | ||
mkdir /tftpboot | |||
cd /tftpboot | cd /tftpboot | ||
wget http://archive.ubuntu.com/ubuntu/dists/gutsy/main/installer-i386/current/images/netboot/netboot.tar.gz | |||
tar zxf netboot.tar.gz | |||
chown -R nobody: . | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#3 tell ''dnsmasq'' to assign addresses starting from <BEGIN_IP_RANGE> until <END_IP_RANGE>, put the server's ip address in <SERVER_IP>, the default gateway must be put in <DEFAULT_GW>, and the dns server in <DNS_SERVER>. Append this to /etc/dnsmasq.conf with your favorite editor: | 1.#3 tell ''dnsmasq'' to assign addresses starting from <BEGIN_IP_RANGE> until <END_IP_RANGE>, put the server's ip address in <SERVER_IP>, the default gateway must be put in <DEFAULT_GW>, and the dns server in <DNS_SERVER>. Append this to /etc/dnsmasq.conf with your favorite editor: | ||
第36行: | 第40行: | ||
Then restart dnsmasq with the following command: | Then restart dnsmasq with the following command: | ||
<pre><nowiki> | <pre><nowiki> | ||
invoke-rc.d dnsmasq restart | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#4 tell ''atftpd'' to run as a server directly, not through ''inetd'' | 1.#4 tell ''atftpd'' to run as a server directly, not through ''inetd'' | ||
<pre><nowiki> | <pre><nowiki> | ||
sed -e '/USE_INETD=/s/true/false/' -i /etc/default/atftpd | |||
invoke-rc.d inetd stop | |||
invoke-rc.d xinetd stop | |||
invoke-rc.d atftpd restart | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#5 check that your firewall is not blocking DHCP/TFTP traffic (UDP) or, alternatively, just turn off the firewall altogether | 1.#5 check that your firewall is not blocking DHCP/TFTP traffic (UDP) or, alternatively, just turn off the firewall altogether | ||
<pre><nowiki> | <pre><nowiki> | ||
iptables -F | |||
iptables -X | |||
iptables -P INPUT ACCEPT | |||
iptables -P FORWARD ACCEPT | |||
iptables -P OUTPUT ACCEPT | |||
iptables -t mangle -F 2>/dev/null | |||
iptables -t mangle -X 2>/dev/null | |||
iptables -t nat -F 2>/dev/null | |||
iptables -t nat -X 2>/dev/null | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#6 everything is ready to run now. Time to verify if everything really works. | 1.#6 everything is ready to run now. Time to verify if everything really works. | ||
第63行: | 第68行: | ||
<pre><nowiki> | <pre><nowiki> | ||
iptables -L | |||
iptables -t nat -L | |||
iptables -t mangle -L | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#2 check if ''dnsmasq'' is listening on the ''bootp'' port 67 | 1.#2 check if ''dnsmasq'' is listening on the ''bootp'' port 67 | ||
<pre><nowiki> | <pre><nowiki> | ||
netstat -nulp | grep '67.*dnsmasq' # should display udp 0 0 0.0.0.0:67 0.0.0.0:* <some num>/dnsmasq | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#3 check if ''atftpd'' is listening on the ''tftp'' port 69 | 1.#3 check if ''atftpd'' is listening on the ''tftp'' port 69 | ||
<pre><nowiki> | <pre><nowiki> | ||
netstat -nulp | grep atftpd # should display udp 0 0 0.0.0.0:69 0.0.0.0:* <some num>/atftpd | |||
</nowiki></pre> | </nowiki></pre> | ||
1.#4 test if you can get the PXE boot kernel via tftp, replace SERVER_IP with your own ip address. | 1.#4 test if you can get the PXE boot kernel via tftp, replace SERVER_IP with your own ip address. |
2008年4月23日 (三) 11:29的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Installation/QuickNetboot }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/af | • {{#if: UbuntuHelp:Installation/QuickNetboot|Afrikaans| [[::Installation/QuickNetboot/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ar | • {{#if: UbuntuHelp:Installation/QuickNetboot|العربية| [[::Installation/QuickNetboot/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/az | • {{#if: UbuntuHelp:Installation/QuickNetboot|azərbaycanca| [[::Installation/QuickNetboot/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/bcc | • {{#if: UbuntuHelp:Installation/QuickNetboot|جهلسری بلوچی| [[::Installation/QuickNetboot/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/bg | • {{#if: UbuntuHelp:Installation/QuickNetboot|български| [[::Installation/QuickNetboot/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/br | • {{#if: UbuntuHelp:Installation/QuickNetboot|brezhoneg| [[::Installation/QuickNetboot/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ca | • {{#if: UbuntuHelp:Installation/QuickNetboot|català| [[::Installation/QuickNetboot/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/cs | • {{#if: UbuntuHelp:Installation/QuickNetboot|čeština| [[::Installation/QuickNetboot/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/de | • {{#if: UbuntuHelp:Installation/QuickNetboot|Deutsch| [[::Installation/QuickNetboot/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/el | • {{#if: UbuntuHelp:Installation/QuickNetboot|Ελληνικά| [[::Installation/QuickNetboot/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/es | • {{#if: UbuntuHelp:Installation/QuickNetboot|español| [[::Installation/QuickNetboot/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/fa | • {{#if: UbuntuHelp:Installation/QuickNetboot|فارسی| [[::Installation/QuickNetboot/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/fi | • {{#if: UbuntuHelp:Installation/QuickNetboot|suomi| [[::Installation/QuickNetboot/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/fr | • {{#if: UbuntuHelp:Installation/QuickNetboot|français| [[::Installation/QuickNetboot/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/gu | • {{#if: UbuntuHelp:Installation/QuickNetboot|ગુજરાતી| [[::Installation/QuickNetboot/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/he | • {{#if: UbuntuHelp:Installation/QuickNetboot|עברית| [[::Installation/QuickNetboot/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/hu | • {{#if: UbuntuHelp:Installation/QuickNetboot|magyar| [[::Installation/QuickNetboot/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/id | • {{#if: UbuntuHelp:Installation/QuickNetboot|Bahasa Indonesia| [[::Installation/QuickNetboot/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/it | • {{#if: UbuntuHelp:Installation/QuickNetboot|italiano| [[::Installation/QuickNetboot/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ja | • {{#if: UbuntuHelp:Installation/QuickNetboot|日本語| [[::Installation/QuickNetboot/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ko | • {{#if: UbuntuHelp:Installation/QuickNetboot|한국어| [[::Installation/QuickNetboot/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ksh | • {{#if: UbuntuHelp:Installation/QuickNetboot|Ripoarisch| [[::Installation/QuickNetboot/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/mr | • {{#if: UbuntuHelp:Installation/QuickNetboot|मराठी| [[::Installation/QuickNetboot/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ms | • {{#if: UbuntuHelp:Installation/QuickNetboot|Bahasa Melayu| [[::Installation/QuickNetboot/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/nl | • {{#if: UbuntuHelp:Installation/QuickNetboot|Nederlands| [[::Installation/QuickNetboot/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/no | • {{#if: UbuntuHelp:Installation/QuickNetboot|norsk| [[::Installation/QuickNetboot/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/oc | • {{#if: UbuntuHelp:Installation/QuickNetboot|occitan| [[::Installation/QuickNetboot/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/pl | • {{#if: UbuntuHelp:Installation/QuickNetboot|polski| [[::Installation/QuickNetboot/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/pt | • {{#if: UbuntuHelp:Installation/QuickNetboot|português| [[::Installation/QuickNetboot/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ro | • {{#if: UbuntuHelp:Installation/QuickNetboot|română| [[::Installation/QuickNetboot/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/ru | • {{#if: UbuntuHelp:Installation/QuickNetboot|русский| [[::Installation/QuickNetboot/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/si | • {{#if: UbuntuHelp:Installation/QuickNetboot|සිංහල| [[::Installation/QuickNetboot/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/sq | • {{#if: UbuntuHelp:Installation/QuickNetboot|shqip| [[::Installation/QuickNetboot/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/sr | • {{#if: UbuntuHelp:Installation/QuickNetboot|српски / srpski| [[::Installation/QuickNetboot/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/sv | • {{#if: UbuntuHelp:Installation/QuickNetboot|svenska| [[::Installation/QuickNetboot/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/th | • {{#if: UbuntuHelp:Installation/QuickNetboot|ไทย| [[::Installation/QuickNetboot/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/tr | • {{#if: UbuntuHelp:Installation/QuickNetboot|Türkçe| [[::Installation/QuickNetboot/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/vi | • {{#if: UbuntuHelp:Installation/QuickNetboot|Tiếng Việt| [[::Installation/QuickNetboot/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/yue | • {{#if: UbuntuHelp:Installation/QuickNetboot|粵語| [[::Installation/QuickNetboot/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/zh | • {{#if: UbuntuHelp:Installation/QuickNetboot|中文| [[::Installation/QuickNetboot/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/zh-hans | • {{#if: UbuntuHelp:Installation/QuickNetboot|中文(简体)| [[::Installation/QuickNetboot/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/QuickNetboot | UbuntuHelp:Installation/QuickNetboot | {{#if: | :}}Installation/QuickNetboot}}/zh-hant | • {{#if: UbuntuHelp:Installation/QuickNetboot|中文(繁體)| [[::Installation/QuickNetboot/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Installation/QuickNetboot|:Installation/QuickNetboot|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Installation/QuickNetboot/zh | | {{#ifexist: Installation/QuickNetboot/zh | | {{#ifeq: {{#titleparts:Installation/QuickNetboot|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Installation/QuickNetboot|1|-1|}} | zh | | }}
There is more than one way to install Ubuntu via netboot, search for netboot in the Ubuntu wiki. This guide aims to give simple, complete and verifiable instructions to get netboot working in a matter of minutes. They are for installing Ubuntu 7.10, but with minor modifications in step 2 they should work for other Ubuntu releases as well.
Before you begin
There should be no other DHCP servers running in the subnet. You might succeed with two servers as well (as I did), but be warned.
DHCP/TFTP server installation
Prepare
0 become the root
sudo su -
- install required software
apt-get install dnsmasq atftp atftpd
1.#2 download and unpack the netboot tarball
mkdir /tftpboot cd /tftpboot wget http://archive.ubuntu.com/ubuntu/dists/gutsy/main/installer-i386/current/images/netboot/netboot.tar.gz tar zxf netboot.tar.gz chown -R nobody: .
1.#3 tell dnsmasq to assign addresses starting from <BEGIN_IP_RANGE> until <END_IP_RANGE>, put the server's ip address in <SERVER_IP>, the default gateway must be put in <DEFAULT_GW>, and the dns server in <DNS_SERVER>. Append this to /etc/dnsmasq.conf with your favorite editor:
dhcp-range=<BEGIN_IP_RANGE>,<END_IP_RANGE>,12h dhcp-boot=pxelinux.0,<SERVER_IP> dhcp-option=3,<DEFAULT_GW> dhcp-option=6,<DNS_SERVER>
An example append is shown here:
dhcp-range=192.168.0.20,192.168.0.30,12h dhcp-boot=pxelinux.0,192.168.0.10 dhcp-option=3,192.168.0.1 dhcp-option=6,192.168.0.1
Then restart dnsmasq with the following command:
invoke-rc.d dnsmasq restart
1.#4 tell atftpd to run as a server directly, not through inetd
sed -e '/USE_INETD=/s/true/false/' -i /etc/default/atftpd invoke-rc.d inetd stop invoke-rc.d xinetd stop invoke-rc.d atftpd restart
1.#5 check that your firewall is not blocking DHCP/TFTP traffic (UDP) or, alternatively, just turn off the firewall altogether
iptables -F iptables -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -t mangle -F 2>/dev/null iptables -t mangle -X 2>/dev/null iptables -t nat -F 2>/dev/null iptables -t nat -X 2>/dev/null
1.#6 everything is ready to run now. Time to verify if everything really works.
Verify
- check iptables, if you turned it off, there should be no rules and the policy should be ACCEPT
iptables -L iptables -t nat -L iptables -t mangle -L
1.#2 check if dnsmasq is listening on the bootp port 67
netstat -nulp | grep '67.*dnsmasq' # should display udp 0 0 0.0.0.0:67 0.0.0.0:* <some num>/dnsmasq
1.#3 check if atftpd is listening on the tftp port 69
netstat -nulp | grep atftpd # should display udp 0 0 0.0.0.0:69 0.0.0.0:* <some num>/atftpd
1.#4 test if you can get the PXE boot kernel via tftp, replace SERVER_IP with your own ip address.
cd /tmp echo 'get pxelinux.0' | atftp SERVER_IP ls -l pxelinux.0 # should display a ~14kB file
Boot the client
Enable PXE boot in BIOS or use Ethertool or whatever makes your client boot off the net. See e.g. http://syslinux.zytor.com/pxe.php .
Problems?
- check syslog (/var/log/syslog)
- use ethereal (wireshark) to inspect network traffic