Hi All, im new with OpenWrt, i've installed in archer c60 router and it's working great but i can't renew my WAN IP.
Im using an cablemodem in bridge mode and i've clonned my Computer mac address in Lucy to get an WAN IP
I've triyed with another router getted new WAN ip and then connect this router and its getted my old WAN ip.
I've tryed via putty commands:
killall -SIGUSR2 udhcpc
killall -SIGUSR1 udhcpc
And still getting my old WAN IP.
What else can i try?
Thks
Why aren't you using LuCI?
Go to Network > Interfaces and click 'Stop' next to the WAN interface, then 'Start' again. Maybe there's even a 'Restart' button.
uci show network
ifup wan; sleep 10; ifstatus wan
yes, i've tryed stop, start, restart with no lucky, always the same WAN IP.
There isn´t relesase and renew buttons in Lucy.
There is no need for release/renew button. The Restart does the same and more. Your ISP is allocating the IP that you get, so you'll need to discuss it with them if you are not happy with what you get.
Thks for the reply.
I dont think my ISP is allocating the IP because when i try realse / renew with a different router (no openwrt) my ip change.
Then try using a different MAC address
Yes, i've tryed that, but when i change my cloned MAC Address or dont leave blank the client id i dont get any WAN ip. So i must reenter my old MAC address and leave blank the client id to get internet.
In the TP-Link firmware, the IP can be renewed.
This is an example of DHCP from cold boot in 18.06.4
Summary
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:08:36.409311 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x7f9621df, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:08:39.572809 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x7f9621df, secs 3, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:08:40.519502 IP (tos 0xc0, ttl 64, id 36606, offset 0, flags [none], proto UDP (17), length 335)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 307, xid 0x7f9621df, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
12:08:40.522703 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x7f9621df, secs 4, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Requested-IP Option 50, length 4: 10.0.2.100
Server-ID Option 54, length 4: 10.0.2.1
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:08:40.526497 IP (tos 0xc0, ttl 64, id 36607, offset 0, flags [none], proto UDP (17), length 335)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 307, xid 0x7f9621df, secs 3, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
12:08:40.995210 IP (tos 0xc0, ttl 64, id 36646, offset 0, flags [none], proto UDP (17), length 348)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 320, xid 0x7f9621df, secs 4, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
12:09:52.584169 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x45a2439b, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:09:52.708761 IP (tos 0xc0, ttl 64, id 39537, offset 0, flags [none], proto UDP (17), length 335)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 307, xid 0x45a2439b, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
12:09:52.735561 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x45a2439b, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Requested-IP Option 50, length 4: 10.0.2.100
Server-ID Option 54, length 4: 10.0.2.1
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:09:52.743438 IP (tos 0xc0, ttl 64, id 39540, offset 0, flags [none], proto UDP (17), length 348)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 320, xid 0x45a2439b, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
As you can see the only identifier of the host is the hostname and the mac address (and the dhcp client).
Here I issued an ifup wan
The client is sending a REQUEST and right after that again a DISCOVER for fresh start. It gets an ACK to the REQUEST and an OFFER for the DISCOVER.
Summary
12:17:29.776843 IP (tos 0x0, ttl 64, id 2136, offset 0, flags [DF], proto UDP (17), length 328)
10.0.2.100.68 > 10.0.2.1.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x45a2439b, Flags [none] (0x0000)
Client-IP 10.0.2.100
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:17:30.397929 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x620bb36b, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:17:30.404386 IP (tos 0xc0, ttl 64, id 500, offset 0, flags [none], proto UDP (17), length 348)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 320, xid 0x45a2439b, Flags [none] (0x0000)
Client-IP 10.0.2.100
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
12:17:30.406572 IP (tos 0xc0, ttl 64, id 501, offset 0, flags [none], proto UDP (17), length 335)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 307, xid 0x620bb36b, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
12:17:30.408931 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x620bb36b, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Requested-IP Option 50, length 4: 10.0.2.100
Server-ID Option 54, length 4: 10.0.2.1
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
12:17:30.411326 IP (tos 0xc0, ttl 64, id 502, offset 0, flags [none], proto UDP (17), length 348)
10.0.2.1.67 > 10.0.2.100.68: [udp sum ok] BOOTP/DHCP, Reply, length 320, xid 0x620bb36b, Flags [none] (0x0000)
Your-IP 10.0.2.100
Server-IP 10.0.2.1
Client-Ethernet-Address xy:zy:xz:00:bb:dd
file "vmlinux"[|bootp]
Finally sends a REQUEST and receives an ACK. In the DISCOVER packet of the "renew" part there is no option 50 enabled (to request a specific IP, which the DHCP server can honour or ignore), so the client is not requesting again the same IP, but lets DHCP server decide and allocate. Usually the DHCP server will continue with the same IP if there is no policy to rotate them.
Hope this answers your questions.
@trendy, if the client doesn't send a DHCPRELEASE
, the server may not issue a new lease and just use the old one until it expires, so in general case the restart doesn't do the same as release+renew.
I tried with release and renew. I got again the same IP, however in my home there are not too many devices to request IP at the same time. Moreover the DISCOVER packet was marked with option 50 for some reason to request again the old IP. However this is an option the DHCP server can ignore.
killall -USR2 udhcpc ; sleep 10; killall -USR1 udhcpc
00:11:34.377203 IP (tos 0x0, ttl 64, id 39347, offset 0, flags [DF], proto UDP (17), length 328)
10.0.2.100.68 > 10.0.2.1.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x2996c4f2, secs 56, Flags [none] (0x0000)
Client-IP 10.0.2.100
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Release
Server-ID Option 54, length 4: 10.0.2.1
END Option 255, length 0
PAD Option 0, length 0, occurs 50
00:11:44.410089 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xy:zy:xz:00:bb:dd, length 300, xid 0x67e8bb3c, Flags [none] (0x0000)
Client-Ethernet-Address xy:zy:xz:00:bb:dd
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Requested-IP Option 50, length 4: 10.0.2.100
MSZ Option 57, length 2: 576
Parameter-Request Option 55, length 8:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
Domain-Name, BR, NTP, Classless-Static-Route
Vendor-Class Option 60, length 12: "udhcp 1.28.4"
Hostname Option 12, length 11: "RoadWarrior"
END Option 255, length 0
PAD Option 0, length 0, occurs 9
It also depends on the DHCP server implementation and configuration:
Probably it tries to preserve the connection tracking or the like.
Note, that neither SIGUSR2
nor SIGUSR1
restart the process.
@virualdo, I suggest to replace SIGUSR1
with SIGTERM
or SIGKILL
.
Thks for the reply.
i Just tryed the commands (i dont know if i´ve used wright)
killall -SIGUSR2 udhcpc
killall -SIGTERM udhcpc
and
killall -SIGKILL udhcpc
And i've got the same WAN IP.
There's no more DHCP-option-50 in the DHCPDISCOVER
if I send SIGUSR2
following by SIGTERM
or SIGKILL
to the process.
However, my testing capabilities are limited by a static IP address.
Both of them are not releasing the lease, so I think the winning combination here is
killall -USR2 udhcpc ; sleep 10; killall -TERM udhcpc
The IP that you get is determined by the server. There is no process to demand a different IP than last time. You can request a specific IP (which is usually used to renew to the same IP), but the server does not need to honor that. If you also change your MAC address you may get a different IP but again that is up to the server.
ok, i understand that.
But with the old tp link firmware i had a release and renew buttons and they gave me a new WAN ip every time.
I used that a lot and now with the same IPS but with OpenWRT i cant do that yet.
Have you found the solution yet? I have the same problem about renewing IP address on OpenWRT
From LuCI, navigate to Network > Interfaces and click Restart for the WAN interface.