How to get both IPv4 and IPv6 dynamic address

8,049

Solution 1

You can issue both commands and have them run concurrently in one line like:

(dhclient &); (dhclient -6 &)

You could then add it to a BASH script or alike, named how you'd like. :)

More info on combining commands in Linux:

Solution 2

If they can't be combined, you'll have to make two separate calls of dhclient and if you want this to run with one command, you could wrap it in a little shell-script. You can find infos on Bash-scripting here.

Share:
8,049

Related videos on Youtube

Qian
Author by

Qian

Updated on September 18, 2022

Comments

  • Qian
    Qian over 1 year

    Running dhclient gets me an IPv4 address.

    Running dhclient -6 gets me an IPv6 address.

    And the man page says you can't combine v4 and v6. So how to get both v4 and v6 addresses at the same time?

    • Michael Hampton
      Michael Hampton almost 11 years
      Doesn't your operating system distribution have network startup scripts to handle this for you?