How to make vlan as dhcp client

I have made vlan in my openwrt router using following commands:-

vconfig add eth1 10
ifconfig eth1.10 up

I have my isc-dhcp-server setup at ubuntu with interface enp4s0.10 having ip as
I am unable to get ip on eth1.10 from dhcp server. Even if I give static ip as

ifconfig eth1.10 up 

That also didn't work.

But if I save settings in my /etc/config/network file then everything works fine.
I want to make vlan as dhcp client but using cli only and not by using any network configuration file, How can I achieve it?

  1. you're using bad (very stripped down) emulations (busybox-) of severely deprecated tools (ifconfig/ vconfig), rather than modern ones (iproute2)
  2. you're disregarding OpenWrt's networking dæmon, which monitors and manages the network interfaces, creating a rift between netifd's idea of how the network should be considered, and what's actually bolted on.
1 Like

I have to run it using ifconfig and vconfig only.
Can you guide me about that?

  • Raw network management is strongly discouraged on OpenWrt.
  • Upgrade OpenWrt to the latest stable officially supported release.
  • Convert all your settings to UCI and avoid using deprecated commands.
1 Like

I think you did not know about it.