Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I would like to have both a static IP or two (different locally routable subnets) and a DHCP virtual interface on a single physical wireless NIC.

Any suggestion on how to address that?

Ubuntu 12.04LTS, Lenovo T61


share|improve this question

1 Answer 1

I'm assuming you're running NetworkManager here, you've already set up your wireless connection using DHCP and you're talking about IPv4 here.

While you can't configure the static addresses in NetworkManager GUI, there's a hack possible.

  1. Find the connection UUID of the connection configured

    $ nmcli con
  2. Add a script in /etc/NetworkManager/dispatcher.d/, containing this starting point:

    if [ "$CONNECTION_UUID" == "$MYCON_UUID" ]; then
        # add alias for Network 1:
        ifconfig $WLAN_DEV:0 netmask up
        # add alias for Network 2:
        ifconfig $WLAN_DEV:1 netmask up
  3. Make sure it has the right permissions (chmod +x /path/to/ and restart NetworkManager:

    $ sudo service network-manager restart

Now when you connect to your wireless connection, it should add the two aliases (check with ifconfig.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.