特殊:Badtitle/NS100:Installation/QuickNetboot:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第12行: | 第12行: | ||
=== Prepare === | === Prepare === | ||
# install required software | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install dnsmasq atftp atftpd | sudo apt-get install dnsmasq atftp atftpd | ||
</nowiki></pre> | </nowiki></pre> | ||
##2 download and unpack the netboot tarball | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo mkdir /tftpboot | sudo mkdir /tftpboot | ||
第26行: | 第26行: | ||
</nowiki></pre> | </nowiki></pre> | ||
##3 tell ''dnsmasq'' to assing addresses starting from <BEGIN_IP_RANGE> until <END_IP_RANGE>, put the servers 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: | |||
<pre><nowiki> | <pre><nowiki> | ||
dhcp-range=<BEGIN_IP_RANGE>,<END_IP_RANGE>,12h | dhcp-range=<BEGIN_IP_RANGE>,<END_IP_RANGE>,12h | ||
第49行: | 第49行: | ||
</nowiki></pre> | </nowiki></pre> | ||
##4 tell ''atftpd'' to run as a server directly, not through ''inetd'' | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo sed -e '/USE_INETD=/s/true/false/' -i /etc/default/atftpd | sudo sed -e '/USE_INETD=/s/true/false/' -i /etc/default/atftpd | ||
第58行: | 第58行: | ||
</nowiki></pre> | </nowiki></pre> | ||
##5 check that your firewall is not blocking DHCP/TFTP traffic (UDP) or, alternatively, just turn off the firewall altogether | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo iptables -F | sudo iptables -F | ||
第71行: | 第71行: | ||
</nowiki></pre> | </nowiki></pre> | ||
##6 everything is ready to run now. Time to verify if everything really works. | |||
=== Verify === | === Verify === | ||
# check ''iptables'', if you turned it off, there should be no rules and the policy should be ''ACCEPT'' | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo iptables -L | sudo iptables -L | ||
第82行: | 第82行: | ||
</nowiki></pre> | </nowiki></pre> | ||
##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 | 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> | ||
##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 | 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> | ||
##4 test if you can get the PXE boot kernel via tftp, replace SERVER_IP with your own ip address. | |||
<pre><nowiki> | <pre><nowiki> | ||
cd /tmp | cd /tmp | ||
第106行: | 第106行: | ||
=== Problems? === | === Problems? === | ||
# check syslog (''/var/log/syslog'') | |||
# use ''ethereal'' to inspect network traffic | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年5月13日 (日) 16:25的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Installation/QuickNetboot }} |
点击翻译: |
English {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/af | • {{#if: php5|Afrikaans| [[::Installation/QuickNetboot/af|Afrikaans]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ar | • {{#if: php5|العربية| [[::Installation/QuickNetboot/ar|العربية]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/az | • {{#if: php5|azərbaycanca| [[::Installation/QuickNetboot/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/bcc | • {{#if: php5|جهلسری بلوچی| [[::Installation/QuickNetboot/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/bg | • {{#if: php5|български| [[::Installation/QuickNetboot/bg|български]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/br | • {{#if: php5|brezhoneg| [[::Installation/QuickNetboot/br|brezhoneg]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ca | • {{#if: php5|català| [[::Installation/QuickNetboot/ca|català]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/cs | • {{#if: php5|čeština| [[::Installation/QuickNetboot/cs|čeština]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/de | • {{#if: php5|Deutsch| [[::Installation/QuickNetboot/de|Deutsch]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/el | • {{#if: php5|Ελληνικά| [[::Installation/QuickNetboot/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/es | • {{#if: php5|español| [[::Installation/QuickNetboot/es|español]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/fa | • {{#if: php5|فارسی| [[::Installation/QuickNetboot/fa|فارسی]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/fi | • {{#if: php5|suomi| [[::Installation/QuickNetboot/fi|suomi]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/fr | • {{#if: php5|français| [[::Installation/QuickNetboot/fr|français]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/gu | • {{#if: php5|ગુજરાતી| [[::Installation/QuickNetboot/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/he | • {{#if: php5|עברית| [[::Installation/QuickNetboot/he|עברית]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/hu | • {{#if: php5|magyar| [[::Installation/QuickNetboot/hu|magyar]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/id | • {{#if: php5|Bahasa Indonesia| [[::Installation/QuickNetboot/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/it | • {{#if: php5|italiano| [[::Installation/QuickNetboot/it|italiano]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ja | • {{#if: php5|日本語| [[::Installation/QuickNetboot/ja|日本語]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ko | • {{#if: php5|한국어| [[::Installation/QuickNetboot/ko|한국어]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ksh | • {{#if: php5|Ripoarisch| [[::Installation/QuickNetboot/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/mr | • {{#if: php5|मराठी| [[::Installation/QuickNetboot/mr|मराठी]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ms | • {{#if: php5|Bahasa Melayu| [[::Installation/QuickNetboot/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/nl | • {{#if: php5|Nederlands| [[::Installation/QuickNetboot/nl|Nederlands]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/no | • {{#if: php5|norsk| [[::Installation/QuickNetboot/no|norsk]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/oc | • {{#if: php5|occitan| [[::Installation/QuickNetboot/oc|occitan]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/pl | • {{#if: php5|polski| [[::Installation/QuickNetboot/pl|polski]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/pt | • {{#if: php5|português| [[::Installation/QuickNetboot/pt|português]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ro | • {{#if: php5|română| [[::Installation/QuickNetboot/ro|română]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/ru | • {{#if: php5|русский| [[::Installation/QuickNetboot/ru|русский]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/si | • {{#if: php5|සිංහල| [[::Installation/QuickNetboot/si|සිංහල]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/sq | • {{#if: php5|shqip| [[::Installation/QuickNetboot/sq|shqip]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/sr | • {{#if: php5|српски / srpski| [[::Installation/QuickNetboot/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/sv | • {{#if: php5|svenska| [[::Installation/QuickNetboot/sv|svenska]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/th | • {{#if: php5|ไทย| [[::Installation/QuickNetboot/th|ไทย]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/tr | • {{#if: php5|Türkçe| [[::Installation/QuickNetboot/tr|Türkçe]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/vi | • {{#if: php5|Tiếng Việt| [[::Installation/QuickNetboot/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/yue | • {{#if: php5|粵語| [[::Installation/QuickNetboot/yue|粵語]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/zh | • {{#if: php5|中文| [[::Installation/QuickNetboot/zh|中文]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/zh-hans | • {{#if: php5|中文(简体)| [[::Installation/QuickNetboot/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/QuickNetboot}}/zh-hant | • {{#if: php5|中文(繁體)| [[::Installation/QuickNetboot/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:php5|: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. The server is running Dapper and the instructions are for installing Dapper, 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
- install required software
sudo apt-get install dnsmasq atftp atftpd
- 2 download and unpack the netboot tarball
sudo mkdir /tftpboot cd /tftpboot sudo wget http://archive.ubuntu.com/ubuntu/dists/dapper/main/installer-i386/current/images/netboot/netboot.tar.gz sudo tar zxf netboot.tar.gz sudo chown -R nobody: .
- 3 tell dnsmasq to assing addresses starting from <BEGIN_IP_RANGE> until <END_IP_RANGE>, put the servers 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:
sudo invoke-rc.d dnsmasq restart
- 4 tell atftpd to run as a server directly, not through inetd
sudo sed -e '/USE_INETD=/s/true/false/' -i /etc/default/atftpd sudo invoke-rc.d inetd stop sudo invoke-rc.d xinetd stop sudo invoke-rc.d atftpd restart
- 5 check that your firewall is not blocking DHCP/TFTP traffic (UDP) or, alternatively, just turn off the firewall altogether
sudo iptables -F sudo iptables -X sudo iptables -P INPUT ACCEPT sudo iptables -P FORWARD ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -t mangle -F 2>/dev/null sudo iptables -t mangle -X 2>/dev/null sudo iptables -t nat -F 2>/dev/null sudo iptables -t nat -X 2>/dev/null
- 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
sudo iptables -L sudo iptables -t nat -L sudo iptables -t mangle -L
- 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
- 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
- 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 13156-byte 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 to inspect network traffic