Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    alf632
    @alf632
    hi there
    i got some problems getting pypxe to fly
    so I start ./pypxe-server.py --dhcp --debug all on the one side and on the other i got a server trying to boot from pxe
    there is no other dhcp in that network
    i can see discoveries coming in
    2015-06-23 11:34:16,878 [DEBUG] PyPXE.DHCP Received message
    2015-06-23 11:34:16,879 [DEBUG] PyPXE.DHCP <--BEGIN MESSAGE-->
    [...]
    2015-06-23 11:34:16,879 [DEBUG] PyPXE.DHCP <--END MESSAGE-->
    2015-06-23 11:34:16,879 [DEBUG] PyPXE.DHCP Parsed received options
    2015-06-23 11:34:16,880 [DEBUG] PyPXE.DHCP <--BEGIN OPTIONS-->
    [...]
    2015-06-23 11:34:16,880 [DEBUG] PyPXE.DHCP <--END OPTIONS-->
    2015-06-23 11:34:16,880 [DEBUG] PyPXE.DHCP PXE client request received
    2015-06-23 11:34:16,880 [DEBUG] PyPXE.DHCP Received DHCPOFFER
    2015-06-23 11:34:16,880 [DEBUG] PyPXE.DHCP DHCPOFFER - Sending the following
    the first thing i wonder about is the statement that an offer was received... as to my understanding the offer is soposed to be the answer to an discovery
    alf632
    @alf632

    the next thing i wonder about is that the server doesn't change its behaviour as it still sends discoveries as if it hasn't received anything... so i started a dhcpdump on the pxe server and captured the packet from the booting server
    0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from [MACADDRESS] (oui Unknown), length 548, xid 0x4edf8e1e, secs 16, Flags [Broadcast] (0x8000)
    Client-Ethernet-Address [MACADDRESS] (oui Unknown)
    Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    Parameter-Request Option 55, length 24:
    Subnet-Mask, Time-Zone, Default-Gateway, IEN-Name-Server
    Domain-Name-Server, RL, Hostname, BS
    Domain-Name, SS, RP, EP
    Vendor-Option, Server-ID, Vendor-Class, BF
    Option 128, Option 129, Option 130, Option 131
    Option 132, Option 133, Option 134, Option 135
    MSZ Option 57, length 2: 1260
    GUID Option 97, length 17: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
    ARCH Option 93, length 2: 0
    NDI Option 94, length 3: 1.2.1
    Vendor-Class Option 60, length 32: "PXEClient:Arch:00000:UNDI:002001"
    END Option 255, length 0
    PAD Option 0, length 0, occurs 212

    but there is no answer packet from PyPXE

    any help with getting the dhcp to answer would be fantastic!
    alf632
    @alf632

    digging through the code of dhcp.py i found
    self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
    self.sock.bind(('', self.port ))

    which lets me think that the dhcp server doesnt bind to self.ip

    alf632
    @alf632
    the issue seems to be, that on my pxe server there are multiple interfaces. from http://stackoverflow.com/questions/8437726/can-python-select-what-network-adapter-when-opening-a-socket I learned how to bind an interface in python an added following line right before self.sock.bind(("", self.port )):
    self.sock.setsockopt(socket.SOL_SOCKET, 25, 'eth1')
    @psychomario do you mind adding that line with an option to configure the bind interface?
    Rory McNamara
    @psychomario
    I would rather bind to self.ip rather than an interface, because we already have a default for self.ip but there won't be a safe default for an interface (I've seen en3p0, eth0, en0, wlan0 and I'm not particularly well travelled). Could you open this as an issue here: https://github.com/psychomario/pypxe/issues and I'll look into fixing this.
    Ian bobbitt
    @icb-
    @alf632, you may have luck with setting the --dhcp-broadcast option to the broadcast address of the subnet you're issuing addresses for (192.168.2.255 with the defaults).
    alf632
    @alf632
    binding on ip didn't work, but setting broadcast worked! THX!
    Ian bobbitt
    @icb-
    Glad to hear. Multi-homed servers is why --dhcp-broadcast was added in the first place.
    alf632
    @alf632
    I was certain that I'm not the only one ^^ THX again!