{
    "version": "https:\/\/jsonfeed.org\/version\/1.1",
    "title": "Аникин: заметки с тегом tftp",
    "_rss_description": "Блог об администрировании Linux, BSD и не только",
    "_rss_language": "ru",
    "_itunes_email": "",
    "_itunes_categories_xml": "",
    "_itunes_image": "",
    "_itunes_explicit": "",
    "home_page_url": "https:\/\/anikin.pw\/tags\/tftp\/",
    "feed_url": "https:\/\/anikin.pw\/tags\/tftp\/json\/",
    "icon": "https:\/\/anikin.pw\/pictures\/userpic\/userpic@2x.jpg?1478690884",
    "authors": [
        {
            "name": "Петр Аникин",
            "url": "https:\/\/anikin.pw\/",
            "avatar": "https:\/\/anikin.pw\/pictures\/userpic\/userpic@2x.jpg?1478690884"
        }
    ],
    "items": [
        {
            "id": "95",
            "url": "https:\/\/anikin.pw\/all\/pxe-server-na-freebsd\/",
            "title": "PXE сервер на FreeBSD",
            "content_html": "<p>В конфиг  dnsmasq добавляем<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">dhcp-option-force=66,192.168.0.1   # ip сервера\ndhcp-option-force=67,gpxelinux.0   # загрузчик<\/code><\/pre><p>Перезапускаем dnsmasq<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">service dnsmasq restart<\/code><\/pre><p>Создаем каталог для pxe<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">mkdir \/usr\/local\/pxe\nmkdir \/usr\/local\/pxe\/pxelinux.cfg<\/code><\/pre><p>Устанавливаем tftp<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">pkg install tftp-hpa<\/code><\/pre><p>В \/etc\/inetd.conf добавляем<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">tftp  dgram  udp  wait  root  \/usr\/local\/libexec\/in.tftpd  in.tftpd -p -s \/usr\/local\/pxe<\/code><\/pre><p>Вписываем<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">echo 'inetd_enable=&quot;YES&quot;' &gt;&gt; \/etc\/rc.conf<\/code><\/pre><p>Запускаем inetd<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">\/etc\/rc.d\/inetd start<\/code><\/pre><p>Скачиваем и распаковываем syslinux<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">fetch http:\/\/www.kernel.org\/pub\/linux\/utils\/boot\/syslinux\/syslinux-4.05.tar.gz\ntar -xf syslinux-4.05.tar.gz<\/code><\/pre><p>Копируем файлы<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">cd syslinux-4.05\ncp gpxe\/gpxelinux.0 \/usr\/local\/pxe\/\ncp com32\/menu\/menu.c32 \/usr\/local\/pxe\/\ncp com32\/menu\/vesamenu.c32 \/usr\/local\/pxe\/\ncp com32\/modules\/reboot.c32 \/usr\/local\/pxe\/\ncp com32\/modules\/chain.c32 \/usr\/local\/pxe\/\ncp memdisk\/memdisk \/usr\/local\/pxe\/<\/code><\/pre><p>Образы будем грузить по http, т.к tftp очень медленный. Ставим nginx.<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">pkg install nginx<\/code><\/pre><p>Создаем каталог с образами и симлинк на него в nginx<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">mkdir  \/usr\/local\/pxe\/images\/\nln -s \/usr\/local\/pxe\/images\/ \/usr\/local\/www\/nginx\/images<\/code><\/pre><p>Вписываем<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">echo 'nginx_enable=&quot;YES&quot;' &gt;&gt; \/etc\/rc.conf<\/code><\/pre><p>И стартуем<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">service nginx start<\/code><\/pre><p>Заливаем наши образы в \/usr\/local\/pxe\/images\/<\/p>\n<p>В файле \/usr\/local\/pxe\/pxelinux.cfg\/default создаем конфиг меню с нашими образами. У меня получился такой<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">ui menu.c32\nmenu title PXE Boot Menu\n\nlabel boothdd\n  menu label Boot from Hard Drive\n  localboot 0\n \nlabel memtest\n  menu label memtest\n  kernel memdisk\n  initrd http:\/\/192.168.0.1\/images\/Memtest86-4.3.7.iso\n  append iso raw\n\nlabel mfsbsd\n  menu label mfsbsd\n  kernel memdisk\n  initrd http:\/\/192.168.0.1\/images\/mfsbsd-12.0-RELEASE-amd64.iso\n  append iso raw\n\nlabel debian-10\n  menu label debian-10\n  kernel http:\/\/192.168.0.1\/images\/debian10\/linux\n  append vga=normal initrd=http:\/\/192.168.0.1\/images\/debian10\/initrd.gz  --\n\nlabel rescue\n  menu label rescue\n  kernel http:\/\/192.168.0.1\/images\/debian10\/linux\n  append vga=normal initrd=http:\/\/192.168.0.1\/images\/debian10\/initrd.gz  rescue\/enable=true --<\/code><\/pre><p>linux и initrd.gz для установщика debian можно взять <a href=\"https:\/\/mirror.yandex.ru\/debian\/dists\/buster\/main\/installer-amd64\/current\/images\/netboot\/debian-installer\/amd64\/\">тут<\/a><br \/>\nТеперь можно пробовать грузится с PXE, если все сделали правильно то появится меню с выбором загружаемого образа.<\/p>\n",
            "date_published": "2019-09-01T18:49:26+03:00",
            "date_modified": "2020-04-29T16:08:01+03:00",
            "tags": [
                "Freebsd",
                "pxe",
                "tftp"
            ],
            "_date_published_rfc2822": "Sun, 01 Sep 2019 18:49:26 +0300",
            "_rss_guid_is_permalink": "false",
            "_rss_guid": "95",
            "_e2_data": {
                "is_favourite": false,
                "links_required": [
                    "highlight\/highlight.js",
                    "highlight\/highlight.css"
                ],
                "og_images": []
            }
        }
    ],
    "_e2_version": 4134,
    "_e2_ua_string": "Aegea 11.3 (v4134)"
}