PXE menu from isolinux.cfg

Questions related to network booting via PXE
rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

PXE menu from isolinux.cfg

Postby rattila » 29 Nov 2010, 13:28

Hi,

What do I have to modify if I want to boot from PXE?

I tried this:

my /tftpserver/pxelinux.cfg/default:

UI resccd/vesamenu.c32
F2 resccd/f2images.msg
F3 resccd/f3params.msg
F4 resccd/f4arun.msg
F5 resccd/f5troubl.msg
F6 resccd/f6pxe.msg
F7 resccd/f7net.msg
...
LABEL rescuecd_std
MENU LABEL 1) SystemRescueCd: default boot options
LINUX resccd/rescuecd
INITRD resccd/initram.igz
APPEND scandelay=1 ar_source=http://192.168.52.102/srv1/ autoruns=1
eth0=192.168.52.111 netboot=tftp://192.168.52.7/resccd/sysrcd.dat cdroot
dns=192.168.52.6 gateway=192.168.52.254 setkmap=hu
TEXT HELP
Boot standard 32bit kernel with default options (should always work)
You should use this entry if you don't know which one to use
ENDTEXT
...

It doesn't work. /sysrcd.dat not found. :-(

Kernel+initrd+menu is all right.

TIA,
Ruzsi

Ps: I found the problem. The APPEND line has to be in the same line.
I will continue modifying that config file booting the other alternative images.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 29 Nov 2010, 14:44

Stop Networkmanager,
Configure the ethernetinterface
Edit /etc/conf.d/pxebootsrv to your wishing.

run /etc/init.d/pxebootsrv start.

Now you have a working server inclusive configfile in /tftpboot.

Gernot

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 29 Nov 2010, 18:26

OK, I understand what you wrote but I don't want to use the SysRescueCD "internal" PXE environment.
I want to run sysresc from my PXE server.

When I have enough time I'll test sysresc's PXE enviro, too.

I want to setup a complex install server with Linux distros (SuSE, RH, Ubuntu), some M$ OSes like XP, W7, 2k8 and some running Linuxes.
I need the good old FreeDOS for example some HDD tester (like Samsung, Seagete) boot it.

Sysresc was the best for me testing my setup and the whole PXE theory before I take a big breath and start M$ OS from PXE server.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 29 Nov 2010, 19:30

Then stop the server and use the configfile and /tftpboot only as working sample

Gernot

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 29 Nov 2010, 19:51

OK.
It is a good idea!

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 01 Dec 2010, 18:11

gernot wrote:Then stop the server and use the configfile and /tftpboot only as working sample

Can you help me solving my DHCP+TFTP problem?

There is a working SysRescCD setup in the LAN where is the DHCP+TFTP server. (both servers are running on the same PC)

I wanted to show that kind of booting possibility to my colleagues on a remote LAN. Both LAN interconnected by WAN and reachable.
The test PC got IP address from DHCP server but that's all. In the log file there aren't any TFTP RRQ lines. DHCPDISCOVER was sent by a DHCP relay server (Ubuntu 9.10) to DHCP server. I manually tested TFTP by tftp program. It was successfull.

Can you tell me any test sws which can check the DHCP parameters the DHCP sent to the client?
On a SuSE 9.0 - which is resided in the same LAN with test PC - dhcpcd-test can be used. I can't any info about next-server or filename options.
I tried to use dhcpdump, too without any success.

Are there any differences between "local" and "remote" LAN DHCP config for booting?

TIA,

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 01 Dec 2010, 21:06

Tried you using "tcpdump -v" and dhclient on the targetbox to get some information? So you shold also see the relay-traffic.

If you use a gPXE bootimage its possible to boot from "named" internetsource.

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 01 Dec 2010, 21:25

tcpdump doesn't help too much for DHCP options. Maybe with dhcpdump.

dhclient for what interface? I'm far away from the target LAN segment. There are some Linux machines. If I try to use dhclient I will drop the interface almost on the floor (on which I connected to the machine over SSH).

So I would need a program which can simulate DHCP process without any interface intervention. dhcpcd-test seems good. I'll test it tomorrow on the working segment. I'm afraid of that dhcpcd-test doesn't show me the full DHCP options. :-(

TIA,

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 02 Dec 2010, 15:01

Tcpdump shold help to see what is sendt..
With tcpdump -i eth1 -v -s 2000 i get the following message
-------------
15:39:26.000386 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328) 192.168.1.5.bootps > 192.168.1.100.bootpc: BOOTP/DHCP, Reply, length 300, xid 0x7de09e02, Flags [none]
Your-IP 192.168.1.100
Server-IP 192.168.1.5
Client-Ethernet-Address 00:e0:7d:e0:9e:02 (oui Unknown)
file "/pxelinux.0"
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Server-ID Option 54, length 4: 192.168.1.5
Lease-Time Option 51, length 4: 21600
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.1.254
Domain-Name-Server Option 6, length 4: 192.168.1.254
-------------------------

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 02 Dec 2010, 18:33

OK, tcpdump helped me.
I used -lexn -i any -s 1500 -w dhcp-debug.cap port bootpc or bootpc or tftp parameters. After that I tried to use dhcpdump.
The dhcpdump was a little bit old on DHCP server so I copied the cap file to an Ubuntu 9.10. Unfortunatly the newer dhcpdump was rewritten and doesn't support pipeing. :-(

So my last idea was Wireshark.

Now the PXE boot is working from an other LAN. The only one problem that it is not absolutelly different, because of interface of the DHCP+TFTP server is connected to that LAN segment, directly.

From a real remote LAN segment something is not good. PXE waiting for something after it pulls the DHCP options. (IP, router, etc.)
I don't know what could be the problem. I've got a photo which was taken by my colleague when the PXE try to do something with the router's IP address.

When the PXE client knows the IP address of the TFTP server is it a unicast communication or needs any helper program or configuration (on router)?

I've got some question about kernel parameters like gateway when the PXE client moves between different LAN segments. My client got the original - which was configured by me - parameter from pxeconfig.cfg/default file where the GW IP was wrong when I moved the other segment.
I know I can change it can I automate it somehow?
It is very interesting the PXE client IP was used from DHCP instead of kernel config parameter (eth0=IP) but default gateway was redefined by parameter. In this situation that was wrong.

TIA,

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 02 Dec 2010, 20:13

rattila wrote:When the PXE client knows the IP address of the TFTP server is it a unicast communication or needs any helper program or configuration (on router)?

There is no helper needed, but the routers must forward UDP port 69 to the server. Make sure the correct gateway is used on server and clientside. Is there a blocking firewall or NAT between segments?

You can use netcat -u to check the transparency of UDP-ports or try tftp from client..

With a modern Etherboot/gPXE image/rom its possible to call dhcp and view or modify recived parameters for testing.

Gernot

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 04 Dec 2010, 17:11

gernot wrote:Is there a blocking firewall or NAT between segments?

No, there isn't.

gernot wrote:You can use netcat -u to check the transparency of UDP-ports or try tftp from client.

It is working now.

There was a problem in my dhcpd.conf.
For the not booting client there was a fixed IP address configuration like this:

#host kontinote-lan-intel {
# hardware ethernet <his MAC addr>;
# fixed-address kontinote,kontinotefr,kontinotefc,kontinoteblk;
#}

The group def. with pxelinux.0:

group {
next-server pxe-server;
filename "pxelinux.0";
# option dhcp-class-identifier "PXEClient";
host amd1 { hardware ethernet 00:0B:6A:1D:A8:61;}
...
host tibo_test { hardware ethernet <his MAC address>;}
}

How can combine the two in one? I want fixed IP address and booting from PXE.
Is the task as simple as putting a next-server pxe-server + 'filename "pxelinux.0" options in fixed-address part?
Or how can I put the fixes-address part in the group definition?

gernot wrote:With a modern Etherboot/gPXE image/rom its possible to call dhcp and view or modify recived parameters for testing.

I used tcpdump (with -i any) + tcpdump. I found the "bad" client didn't ask filename! And it was true, as I mentioned above.

Other question: Look at the sysresccd parameters below.
APPEND scandelay=1 ar_source=http://webserv/srv1/ autoruns=1 eth0=<IP> netboot=tftp://pxe-server/resccd/sysrcd.dat cdroot dns=dns-server gateway=gw setkmap=hu

eth0 was redefined by DHCP. It is very good. What about gateway? It was remained and it was wrong! The client was in different segment.
Of course, I can modify the parameter or I can write a new LABEL for every LAN segment but I've got more than 30!
Any easier solution?

TIA,

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 04 Dec 2010, 19:16

rattila wrote: I want fixed IP address and booting from PXE.

One IP for all clients or one fix for every mac?

for first using " range dynamic-bootp 192.168.1.100 192.168.1.100;
is worth a try, but use a short leasetime.

for second use this like predefined
-------
# if we want to define an IP address for a mac address
host pxeclient {
hardware ethernet 00:1C:C4:43:10:86;
fixed-address 192.168.1.86;
}
---------
This should also work in group

----------------------------------
APPEND scandelay=1 ar_source=http://webserv/srv1/ autoruns=1 eth0=<IP>

This must be an old appendline. In my scripts eth0= is never used. Instead the system use dhcp to get its parameters. This is save because the box got seconds before starting the kernel working parameters per dhcp. Only removing eth0= can work.


Gernot

rattila
Posts: 22
Joined: 26 Jun 2010, 14:16
Location: Budapest, Hungary

Re: PXE menu from isolinux.cfg

Postby rattila » 04 Dec 2010, 20:24

gernot wrote:One IP for all clients or one fix for every mac?

I want fixed address for a given MAC.

Code: Select all

        # if we want to define an IP address for a mac address
        host pxeclient {
                hardware ethernet      00:1C:C4:43:10:86;
                fixed-address          192.168.1.86;
        }

I want that.
So I have to move fixed address definition into the group def.?
Is that working moving next-server and filename params to the above
fixed address definition? Like this:

Code: Select all

# if we want to define an IP address for a mac address
        host pxeclient {
                next-server         pxe-server;
                filename             "pxelinux.0";
                hardware ethernet      00:1C:C4:43:10:86;
                fixed-address          192.168.1.86;
        }


Only removing eth0= can work.

That APPEND line was from the doc.
I'll remove eth0, dns and gateway options because they comes from DHCP.

TIA,

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: PXE menu from isolinux.cfg

Postby gernot » 04 Dec 2010, 21:00

i would give this an try

Code: Select all

group {
next-server pxe-server;
filename "pxelinux.0";
# option dhcp-class-identifier "PXEClient";
host amd1 { hardware ethernet 00:0B:6A:1D:A8:61; fixed-address 192.168.1.86;}
...
host tibo_test { hardware ethernet <his MAC address>; fixed-address 192.168.1.87;}
}


Return to “Network Boot via PXE”

Who is online

Users browsing this forum: No registered users and 1 guest