[Dnsmasq-discuss] bug:DHCP Relay not responding with DHCP OFFER.

2017-04-27 Thread Jason Kary
Hi Folks,

I have a basic setup for DHCP relay across VLANS in DNSMASQ.  

My configuration file looks like: 

bogus-priv
interface=ens160
log-dhcp
dhcp-range=10.168.102.100,10.168.102.150,255.255.255.0,12h

The client and server are running on a VMs in separate VLANS.  DHCP requests 
appear to be coming across:

root@DHCP-UBUNTU-SERVER:~# tcpdump -i ens160 port 67 or port 68 -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens160, link-type EN10MB (Ethernet), capture size 262144 bytes
03:58:40.966944 IP 10.168.102.1.67 > 10.168.101.20.67: BOOTP/DHCP, Request from 
00:0c:29:65:e0:ea, length 322
03:58:46.487767 IP 10.168.102.1.67 > 10.168.101.20.67: BOOTP/DHCP, Request from 
00:0c:29:65:e0:ea, length 322
03:58:54.424895 IP 10.168.102.1.67 > 10.168.101.20.67: BOOTP/DHCP, Request from 
00:0c:29:65:e0:ea, length 322
03:59:07.795712 IP 10.168.102.1.67 > 10.168.101.20.67: BOOTP/DHCP, Request from 
00:0c:29:65:e0:ea, length 322
03:59:19.196022 IP 10.168.102.1.67 > 10.168.101.20.67: BOOTP/DHCP, Request from 
00:0c:29:65:e0:ea, length 322

root@DHCP-UBUNTU-SERVER:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source   destination

Chain FORWARD (policy ACCEPT)
target prot opt source   destination

Chain OUTPUT (policy ACCEPT)
target prot opt source   destination
root@DHCP-UBUNTU-SERVER:~#

The syslog log indicates the DCHP OFFERS are ‘supposed’ to be going out however 
nothing is seen on the wire.

Apr 27 04:03:26 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 available 
DHCP range: 10.168.102.100 -- 10.168.102.150
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 
DHCPDISCOVER(ens160) 00:0c:29:65:e0:ea
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 tags: ens160
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 
DHCPOFFER(ens160) 10.168.102.128 00:0c:29:65:e0:ea
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 requested 
options: 1:netmask, 28:broadcast, 2:time-offset, 121:classless-static-route,
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 requested 
options: 15:domain-name, 6:dns-server, 12:hostname,
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 requested 
options: 40:nis-domain, 41:nis-server, 42:ntp-server,
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 requested 
options: 26:mtu, 119:domain-search, 3:router, 121:classless-static-route,
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 requested 
options: 249, 33:static-route, 252, 42:ntp-server
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 next server: 
10.168.101.20
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
1 option: 53 message-type  2
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option: 54 server-identifier  10.168.101.20
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option: 51 lease-time  12h
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option: 58 T1  6h
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option: 59 T2  10h30m
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option:  1 netmask  255.255.255.0
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option: 28 broadcast  10.168.102.255
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option:  3 router  10.168.102.1
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size:  
4 option:  6 dns-server  10.168.101.20
Apr 27 04:03:29 DHCP-UBUNTU-SERVER dnsmasq-dhcp[17767]: 1121794364 sent size: 
20 option: 82 agent-id  01:0a:01:08:00:06:00:4c:4f:2a:00:2f:02:06…

I’ve been trying to trace this issue and it is like the sendmsg system call is 
not working properly.  I believe routing is setup properly on the DHCP server.

root@DHCP-UBUNTU-SERVER:~# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags   MSS Window  irtt Iface
0.0.0.0 172.31.13.1 0.0.0.0 UG0 0  0 ens192
10.168.101.00.0.0.0 255.255.255.0   U 0 0  0 ens160
10.168.102.00.0.0.0 255.255.255.0   U 0 0  0 ens160
172.31.13.0 0.0.0.0 255.255.255.0   U 0 0  0 ens192
root@DHCP-UBUNTU-SERVER:~#

Can anyone seen something obvious that I am doing wrong?

Take Care
Jason___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] dhcp vendor-option and grub net_pxe_extensionspath

2017-04-27 Thread Carl Karsten
I am looking for the syntax of dhcp vendor options, and then how to access
them in grub-net.  I think.  maybe there is a better way.

I pxe boot grub, which boots di (Debian Installer) and pass a preseed file.

I am trying to work out a nice way to pass host specific info to di
example, most use:
partman-auto/disk="/dev/sda"
but one machine has an onboard ssd nvme which needs /dev/nvme0n1

di will read values appended to the kernel boot line, so I can hard code it
like this:

menuentry "Install Ubuntu preseed" {
set gfxpayload=keep
linux /ubuntu-installer/amd64/linux gfxpayload=800x600x16,800x600 ---
auto=true url=dc10b hostname= partman-auto/disk="/dev/nvme0n1"
interface=${net_default_mac}
initrd /ubuntu-installer/amd64/initrd.gz
}

interface=${net_default_mac} - use the nic that pxe booted.

Now I get lost in conf options and syntax.  forgive me for making stuff up
here, if it worked I wouldn't be asking for help.

I am hoping for something like
partman-auto/disk=$(net_pxe_extensionspath/disk}

in dnsmasq conf:
dhcp-host=40:8d:5c:7f:bb:90,,gator

dhcp-option-force=host:gator,209,"disk=/dev/nvme0n1"


So yeah, how do I send random strings based on mac/hostname
and how do I read what was sent in grub?

-- 
Carl K
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss