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:
- http://www.comptechdoc.org/os/linux/manual2/runningcommands.html
- http://ubuntuforums.org/showthread.php?t=531589
- https://stackoverflow.com/questions/13077241/execute-combine-multiple-linux-commands-in-one-line
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.
Related videos on Youtube
Author by
Qian
Updated on September 18, 2022Comments
-
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 almost 11 yearsDoesn't your operating system distribution have network startup scripts to handle this for you?
-