1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't get DHCP working on WAN ?

Discussion in 'Tomato Firmware' started by Kobalt, Dec 22, 2013.

  1. Kobalt

    Kobalt Reformed Router Member

    This is odd, no matter what I try, I can't get a IP from Charter from the cable modem.
    Using tomato shibby 1.28 on a Asus n66u.

    What happens is, it first pulls down a 192.168.100 IP from cable modem (which is correct), then it goes to 0.0.0.0, and hitting 'renew' won't bring up anything.
    Logs don't show anything of value. I even waited for over 10 mins... nadda.

    The only way I can get it to work is, hook up my old router up (DD-wrt), it pulls down 192.168.1.100 like before, then after about 20 secs after it is 0.0.0.0, it gets the real IP.

    I then disconnect the old router, and plug in the new router, and work that way. (I already cloned the MAC of the 1st router, and NO, I am not required to use a certain MAC).

    After some reading around, I noticed on openwrt page, it says:
    I do have a DOCSIS 3 modem from Charter, but I am unsure where to enable that flag on tomato ?

    Any pointers on how to enable the above flag, or trouble shoot DHCP ?
     
  2. darkknight93

    darkknight93 Networkin' Nut Member

    which Version of tomato shibby are you using? v115?
     
  3. Kobalt

    Kobalt Reformed Router Member

    Yeah... this one.
    tomato-K26USB-1.28.RT-N5x-MIPSR2-115-AIO-64K.trx
     
  4. darkknight93

    darkknight93 Networkin' Nut Member

    can you try to power off all devices, power on Cable Modem, wait 2 minutes and afterwards power on your tomato router?
    Although i think this wont do the trick, is the old router still available? Do you get Internet Connection there?
     
  5. Kobalt

    Kobalt Reformed Router Member

    Tried that... didn't pull down a IP with tomato.
    I did this to be specific:
    Try1: Unplug cable modem, turn off router.
    Turn on router.
    Turn on Cable modem.
    Go to the cable modem's status page so I can see what it is doing... (I have a 192.168.1.100 WAN IP now)
    Cable modem finishes up, I now have a 0.0.0.0 WAN IP.
    Click renew... 10 mins later, still nothing.

    (this is when I do the same thing with old router, and when that pulls down a IP, I swap cables)

    Try #2:
    turn off cable modem & router.
    Turn on cable modem.
    Wait for it to sync up (all LEDs show normal).
    (takes about 2 mins or so)
    Turn on router.
    It won't pull down a IP, it still is 0.0.0.0
    Put old router to pull down the DHCP IP, that works, now, swap cables.


    Yeah, old router is still here, I mainly use it as a AP now, and yeah, still have net connection.
     
  6. koitsu

    koitsu Network Guru Member

    Some cable ISPs actually log or keep track of the MAC address of the device (ex. router) attached to the Ethernet port on the cable modem, and "register" it within their systems (not just for DHCP, but for general provisioning and cable network "stuff"). A new router will have a different MAC address than the old router.

    I strongly recommend you contact your ISP and explain the situation. Tell them that you're upgrading your home router, and after doing so you can no longer get a DHCP lease from their DHCP servers, but if you put your old router back on it works fine. They may ask you what the MAC address of the new router's WAN port is, which is under Advanced / MAC Address / WAN Port. Be sure you explain to the CSR that you are talking about the Ethernet MAC address of the device attached to the cable modem, and not the MAC address of the cable modem itself (sometimes called the CPE address).

    As for setting the broadcast flag in DHCP packets: OpenWRT uses a completely different DHCP client than Tomato, and I have no idea what DD-WRT uses.

    Tomato uses a modified version of the Busybox DHCP client called udhcpc ("Micro DHCP Client"), which does have a flag for enabling the broadcast bit in DHCP packets. The flag is -B. Telnet into the router and run udhcpc -h and see for yourself. For testing, you will need to kill off the existing udhcpc process and restart it (with the same flags as default, but with -B added). There may be a way to set this flag or option somehow through Advanced / DHCP/DNS / DHCPC Options. I don't know what that field affects (ex. if it uses -x or if it just blindly appends arguments to the command line or what). One would have to go look at the source code for how it's used.

    P.S. -- DO NOT be tempted to change ("spoof") the old MAC address under Advanced / MAC Address / WAN Port; you claim to have already done this ("(I already cloned the MAC of the 1st router, and NO, I am not required to use a certain MAC)") and this may be part of your problem. That feature is extremely spotty/unreliable and there are posts about this fact on this forum. There is also a period of time where when the router reboots the true/real MAC address seen on the network, which may cause complications (some ISPs will flag your account if they see more than 1 MAC address coming through the cable modem). You shouldn't use this feature.
     
  7. gfunkdave

    gfunkdave LI Guru Member

    Some Comcast modems remember the WAN MAC of your router (as koitsu mentioned above) and will only give a dhcp address to that MAC. When switching routers at my parents' house, for example, I have to unplug their cable modem and remove the battery, count to 30, then replace the battery and plug the power back in. After that, it will work.
     
  8. Kobalt

    Kobalt Reformed Router Member

    With the old router (DD-WRT), I can spoof a MAC address every 10 mins, if I wanted, and I would get assigned a new IP address each & every time.
    That is why I said they don't tie MACs to the cable modem.

    Koistu, thanks for that info, I'll try it the next time I reboot the cable modem.
    What is bugging me the most is, why it don't show anything in the logs ? I would assume that when you hit 'renew', it would have something in the logs (default log level). So, at least I can see that it is trying something..
    I also read about the FW blocking DHCP requests
    Unsure if that is the problem here either.
     
  9. koitsu

    koitsu Network Guru Member

    Regarding DHCP logging: Administration / Logging / DHCP Client. By default this option is unchecked.

    Otherwise launch udhcpc manually from the CLI without the -b and -S flags (run what I said above to see what those flags do), and instead add -f. The "logging" you see in this mode is limited based on the code within Busybox; you are free to review the source (relevant: dhcpc.c) or file a bug/ticket with the Busybox folks if there's something you want. IF_UDHCP_VERBOSE is not set for udhcpc in Tomato, thus the code for supporting the -v argument (increased verbosity) is missing. You will need to compile the firmware yourself to get that functionality. Same goes for CONFIG_UDHCP_DEBUG.

    Re: firewall: it is not the problem and whoever told you that is wrong. Look at num 7 below, which clearly shows working functionality (packet and byte counters increasing). The source port + destination port rule is correct for all forms of DHCP based on how the protocol works.

    Code:
    root@gw:/tmp/home/root# iptables -L INPUT -n -v --line-numbers
    Chain INPUT (policy DROP 9 packets, 562 bytes)
    num  pkts bytes target  prot opt in  out  source  destination
    1  1155 78711 DROP  all  --  *  *  0.0.0.0/0  0.0.0.0/0  state INVALID
    2  13330 1945K ACCEPT  all  --  *  *  0.0.0.0/0  0.0.0.0/0  state RELATED,ESTABLISHED
    3  100 10798 ACCEPT  all  --  lo  *  0.0.0.0/0  0.0.0.0/0
    4  18734 2412K ACCEPT  all  --  br0  *  0.0.0.0/0  0.0.0.0/0
    5  437K  28M ACCEPT  icmp --  *  *  0.0.0.0/0  0.0.0.0/0
    6  0  0 ACCEPT  udp  --  *  *  0.0.0.0/0  0.0.0.0/0  udp dpts:33434:33534
    7  55199  19M ACCEPT  udp  --  *  *  0.0.0.0/0  0.0.0.0/0  udp spt:67 dpt:68
    8  24  1440 ACCEPT  tcp  --  *  *  0.0.0.0/0  0.0.0.0/0  tcp dpt:113
    
    I remember reading somewhere how some ISPs actually require "specific data" in the DHCP client hostname option portion of the packet; whether or not your ISP is one of these is unknown. This would refer to the -H and -h options of udhcpc. udhcpc also has an option -C that may be relevant to your situation. You will need to experiment.
     
  10. Kobalt

    Kobalt Reformed Router Member

    To follow up, after adding "--retries=2 --timeout=5 --tryagain=310" that does indeed work, and I can pull down a IP via DHCP again.

    I guess that means, that before, it was trying too fast ?

    Also, note, that even after doing a random # for a MAC clone, it still worked fine after cable modem was rebooted.

    Code:
    Jan 14 09:59:35 Tomato daemon.info udhcpc[28650]: Sending select for XXXXXXXX ...
    Jan 14 09:59:35 Tomato daemon.info udhcpc[28650]: Lease of XXXXXXX obtained, lease time 3600
    Jan 14 09:59:35 Tomato user.debug dhcpc-event[30109]: 182: pptp peerdns disabled
    Jan 14 09:59:35 Tomato user.debug init[1]: 182: pptp peerdns disabled
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[28526]: reading /etc/resolv.dnsmasq
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[28526]: using nameserver 8.8.8.8#53
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[28526]: using nameserver 4.2.2.2#53
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[28526]: exiting on receipt of SIGTERM
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: started, version 2.67 cachesize 1500
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset Tomato-helper auth
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: asynchronous logging enabled, queue limit is 5 messages
    Jan 14 09:59:35 Tomato daemon.info dnsmasq-dhcp[30112]: DHCP, IP range 192.168.1.10 -- 192.168.1.20, lease time 1d
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: reading /etc/resolv.dnsmasq
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: using nameserver 8.8.8.8#53
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: using nameserver 4.2.2.2#53
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: read /etc/hosts - 2 addresses
    Jan 14 09:59:35 Tomato daemon.info dnsmasq[30112]: read /etc/dnsmasq/hosts/hosts - 3 addresses
    Jan 14 09:59:35 Tomato daemon.info dnsmasq-dhcp[30112]: read /etc/dnsmasq/dhcp/dhcp-hosts
    Jan 14 09:59:39 Tomato daemon.notice miniupnpd[30401]: version 1.8 started
    Jan 14 09:59:39 Tomato daemon.notice miniupnpd[30401]: HTTP listening on port 17640
    Jan 14 10:00:02 Tomato syslog.info root: -- MARK --
    Jan 14 10:29:40 Tomato daemon.info udhcpc[28650]: Sending renew...
    Jan 14 10:29:40 Tomato daemon.info udhcpc[28650]: Lease of XXXXXXX obtained, lease time 28800
    Jan 14 11:00:01 Tomato syslog.info root: -- MARK --
    
     
    Last edited: Jan 14, 2014
    darkknight93 likes this.

Share This Page