OpenWrt Forum Archive

Topic: dynamic IP

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi

I have Cable connection with dynamic IP but when my IP changes OpenWRT doesn't refreshes IP. (lan works but wan not)
It's the same thing when I restart Cable modem.
I need manually reload network everytime.
Is it ISP or OpenWRT related problem?

I have Asus wl-500gp v1.
Tried 2.6 and 2.4 too.

/etc/config/network

config 'switch' 'eth0'
    option 'vlan0' '1 2 3 4 5*'
    option 'vlan1' '0 5'

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

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

config 'interface' 'wan'
    option 'ifname' 'eth0.1'
    option 'proto' 'dhcp'
    option 'defaultroute' '0'
    option 'peerdns' '0'

/etc/config/dhcp

config 'dnsmasq'
    option 'local' '/lan/'
    option 'domain' 'lan'
    option 'leasefile' '/tmp/dhcp.leases'
    option 'resolvfile' '/tmp/resolv.conf.auto'
    option 'domainneeded' '1'
    option 'authoritative' '1'
    option 'boguspriv' '1'
    option 'localise_queries' '1'
    option 'expandhosts' '1'
    option 'readethers' '1'

config 'dhcp' 'lan'
    option 'interface' 'lan'
    option 'start' '100'
    option 'limit' '150'
    option 'leasetime' '12h'
    option 'ignore' '0'

config 'dhcp' 'wan'
    option 'interface' 'wan'
    option 'ignore' '1'

Is there a dhcp-server running on the cable modem?
I think the dynamic IP changes at the outgoing network device on the modem and not at the internal, there should be a static none. You can give the wan device of the asus a static IP with gateway and dns adresses of the internal network of the router and it should work.

Is the lease time correct for the IP on the WAN interface?
See the system log for messages from udhcpc.
If the lease time reported does not match (i. e. is too long), udhcpc will not request a new IP in time.

The discussion might have continued from here.