What's new

ASUSwrt: How to get VLAN specific IP address for the AP via DHCP

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

A.D.

Regular Contributor
Running ASUSwrt-Merlin 380.70 (but in this regard, there should be no difference to ASUSwrt).

The device is set up as an access point. Starting from there, a script introduces VLANs which map traffic to various SSIDs and LAN ports; the WAN port is the trunk.

How can I have the ASUS box (access point) send out DHCP requests for itself (its config UI etc) via a given VLAN? It's easy to get none (that's the default) or have a static one (ifconfig for the related bridge does the job). But how can I tell the bridge to get an IP address via DHCP?
 
You need to use the DHCP client (/sbin/udhcpc) and specify the appropriate options. If you dump the process table (ps), you'll see the one running on the WAN.

Code:
 1842 admin     1428 S    /sbin/udhcpc -i vlan2 -p /var/run/udhcpc0.pid -s /tmp/udhcpc -O33 -O249

Use udhcpc --help to see all the options.
 
You need to use the DHCP client (/sbin/udhcpc) and specify the appropriate options. If you dump the process table (ps), you'll see the one running on the WAN. [...]

Thank you, that's a good starting point. I was wondering how its start is actually triggered, though. There are entries such as wan_proto=dhcp in the NVRAM so I was hoping to configure stuff there.

When I enable DHCP on WAN in AP mode, I indeed can see one instance of udhcpc running. Unfortunately, it's called with a script that appears to be binary and I came across an (old) article saying that there are versions of such scripts which mess up "unexpected" config when they are triggered upon events (such as renewing the lease). In fact, it could be that I saw such an effect, so I may have to provide a config change tolerant script...

But apart from that, I'll try to start it in my services-start script when I'm sure that it doesn't mess with the rest of my config modifications.
 
It's not as if you need to somehow trick the router into using your script in lieu of the WAN's use of udhcpc. If the WAN is disabled, udhcpc simply doesn't run. And at that point, you can (as you've already suggested) start udhcpc on the LAN's network interface, presumably in the services-start script.

Frankly, I don't know for sure what the WAN's script does (as you said, it's binary), so I don't know how vital it is to replicate that script for your purposes. The WAN script could be completely unrelated to your needs. For example, it may trigger the DDNS client (because the WAN ip changed), and/or maybe is triggers the wan-start event. None of which are relevant to you.
 
Frankly, I don't know for sure what the WAN's script does (as you said, it's binary), so I don't know how vital it is to replicate that script for your purposes. The WAN script could be completely unrelated to your needs. For example, it may trigger the DDNS client (because the WAN ip changed), and/or maybe is triggers the wan-start event. None of which are relevant to you.

Thanks! - Yes, it should. But it seems it was not user config tolerant once and I presume the binary version was done by ASUS. And to me, some things in ASUSwrt look "partially hardwired" so I wouldn't be surprised if assumptions are being mede there which could stand in my way.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top