0

I understand that what I am asking has been asked a million times already. I think I have read just about every post I can find on the subject yet I still cannot get this to work.

I have a DHCP server (centos 6.x) sitting in vlan1. I am running a cisco 3750 switch with multiple vlans (vlan1 = 192.168.1.x and vlan3 = 192.168.3.x) I have added an ip helper-address to vlan3 which points to the DHCP server in vlan1. I am able to see the traffic coming from the server in vlan3. However, I am not able to get an IP address for the vlan3 subnet. I keep getting an IP address for the vlan1 subnet.

Even when I specify my mac in the dhcpd.conf file I get a 192.168.1.x ip for vlan1.

dhcpd.conf == MAC changed intentionally

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.2 192.168.1.254;
  option broadcast-address 192.168.1.255;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.1;
}

subnet 192.168.3.0 netmask 255.255.255.0 {
  range 192.168.3.2 192.168.3.254;
  option broadcast-address 192.168.3.255;
  option subnet-mask 255.255.255.0;
  option routers 192.168.3.1;
}

 host node35 {
   hardware ethernet xx:xx:35:zz:bb:bb;
   fixed-address 192.168.3.101;
 }

 }

tcpdump -vvvnes0 -i eth0 port 67 or port 68

[root@server ~]# tcpdump -vvvnes0 -i eth0 port 67 or port 68
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
13:52:36.475951 cc:zz:pp:zz:cc:pp > xx:xx:zz:62:bb:ee, ethertype IPv4 (0x0800), length 590: (tos 0x0, ttl 63, id 4, offset 0, flags [none], proto UDP (17), length 576)
0.0.0.0.bootpc > 192.168.1.79.bootps: [udp sum ok] BOOTP/DHCP, Request from xx:xx:35:zz:bb:bb, length 548, xid 0x3ab89bbc, secs 64, Flags [Broadcast] (0x8000)
  Client-Ethernet-Address xx:xx:35:zz:bb:bb
  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.54.51.51.55.55.56.65.85.68.50.49.50.48.55.57.71
    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
13:52:37.000710 xx:xx:zz:62:bb:ee > Broadcast, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
192.168.1.79.bootps > 255.255.255.255.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x3ab89bbc, secs 64, Flags [Broadcast] (0x8000)
  Your-IP 192.168.1.2
  Client-Ethernet-Address xx:xx:35:zz:bb:bb
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Offer
    Server-ID Option 54, length 4: 192.168.1.79
    Lease-Time Option 51, length 4: 43200
    Subnet-Mask Option 1, length 4: 255.255.255.0
    Default-Gateway Option 3, length 4: 192.168.1.5
    Domain-Name-Server Option 6, length 4: 192.168.1.42
    Domain-Name Option 15, length 16: "myorg.org"
    END Option 255, length 0
    PAD Option 0, length 0, occurs 8

Switch

3750X.Inside#sh ru int vlan3
Building configuration...

Current configuration : 93 bytes
!
interface Vlan3
ip address 192.168.3.1 255.255.255.0
ip helper-address 192.168.1.79
end

My question is how do I get this to work. Is there something I am missing?

inunendo
  • 1
  • 1
  • 2
  • Show the network interfaces on the linux system (`ip a`). With what parameters is dhcpd being started? – wurtel Mar 31 '15 at 11:07
  • Default server init.d dhcpd startup script with no other parameters being set. `eth0 Link encap:Ethernet HWaddr xx:xx:zz:62:bb:ee inet addr:192.168.1.79 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::5054:ff:fe62:b0e5/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:313612625 errors:0 dropped:0 overruns:0 frame:0 TX packets:23576786 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:167145731253 (155.6 GiB) TX bytes:23301323156 (21.7 GiB)` – inunendo Mar 31 '15 at 12:46
  • it's customary to edit the question to add such info, as it's much more readable. However I can see that the system only has a 192.168.1.0/24 network connected, dhcpd will ignore the 192.168.3.0/24 network definition as it's not in broadcast domain of that network which is necessary to allow dhcpd to do its work. You need to add a `vlan3` network on the linux system (and configure the switch to send that vlan tagged to the system) and also to tell dhcpd what interfaces to listen to, i.e. `eth0` and `vlan3`. Also I asked for `ip a` style output, not the obsolete `ifconfig` output. – wurtel Mar 31 '15 at 12:50
  • OK, this was solved. I did not need to add vlan3 to the NIC on my DHCP server in VLAN1. The ip helper-address deals with passing the information between the two VLANs. I did need to set `shared-network NAME { }`. Once that was done I was getting an IP from the correct VLAN. – inunendo Apr 01 '15 at 15:18

0 Answers0