Dhcp not working on WAN to ISP router, static IP working but no internet

Hi,

I have installed OpenWrt 17.01.6 on my old D-LINK DIR-600 rev.B2. Lan & Wifi are working correctly however when I try to connect the WAN port to my ISP router (a Huawei HG8045H) as a DHCP client it does not seem to be able to get an IP.
Here is my setup:
archi_maison

When I use it as a dhcp client, udhcpc seems to send requests and that's it : daemon.notice netifd: wan (1888): udhcpc: sending discover
When I use static IP, I can ping 192.168.100.1 but not 8.8.8.8 for example.

Any idea in what could be wrong ? I've even tried to put the IP in DMZ on my ISP router without success.

Thank you in advance.

Perhaps MAC address filtering on the ISP router.

See also:

1 Like
  • Can you check the cable? If you connect some other device with the same cable to the same port (#4) does it work? Did you try other ports?
  • Check also MTU on the wan interface that it is 1500.
  • Did you change anything in the firewall rules by any chance? The default ones should work out of the box.
  • I'd ask you to run tcpdump, but I am not sure if you can get internet on the DIR-600 somehow.
3 Likes

No MAC filtering or anything.

  • What about network.wan.clientid?
  • Also note the reply from @trendy.

Thank you for your answer:

  • I have tried different cables and ports.
  • MTU is not overridden, set at 1500 by default
  • I use the default firewall rules
  • tcpdump does not seem installed by default isn't it ? Should I install it ?

I have no clientid configured.

Here is my config /etc/config/network:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd19:8f6c:9bf2::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device 'lan_dev'
        option name 'eth0.1'
        option macaddr 'fc:75:16:99:e3:5c'

config interface 'wan'
        option _orig_ifname 'eth0.2'
        option _orig_bridge 'false'
        option ifname 'eth0.2'
        option proto 'static'
        option ipaddr '192.168.100.1'
        option netmask '255.255.255.0'
        option gateway '192.168.100.1'
        option dns '8.8.8.8'

config device 'wan_dev'
        option name 'eth0.2'
        option macaddr 'fc:75:16:99:e3:5d'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'rt305x'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'rt305x'
        option vlan '1'
        option ports '0 1 2 3 6t'

config switch_vlan
        option device 'rt305x'
        option vlan '2'
        option ports '4 6t'
1 Like

You cannot have same IP for address and gateway.

If you can manage to connect the router somehow on the internet, it would help troubleshoot the DHCP packet exchange.

2 Likes

You are correct my bad, I already changed the IP to 192.168.100.10 but forgot to export the config again after. I managed to connect to the other router at 192.168.100.1 but not the internet :s I am gonna have a look at tcpdump then.

Alright, let's see them all together in action:

cat /etc/config/network; cat /etc/config/firewall ; cat /etc/config/dhcp ; ip -4 addr ; ip -4 ro ; ip -4 ru; traceroute 8.8.8.8; nslookup www.google.com;
1 Like

Yes correct, for the IP in fact it is 192.168.100.10 for my openwrt router and 192.168.100.1 being the isp router, I've fixed it earlier forgot to export the config again. I am gonna have a look to tcpdump then.