Setting IP address if DHCP server fails at bootup
up vote
0
down vote
favorite
Is there a way to set default eth0 setup in linux. I know I can give it a default static IP at boot up with sudo ip route add default via 10.0.0.1 dev eth0
. Is there a way to change it to DHCP at bootup. AND if it's in DHCP but I do NOT have my ethernet cable connected to the network, I want it to be set to an IP address so that it always has a way to be able to connect to it at bootup without any extra commands from the terminal. So.... a default IP address if a DHCP address is not found. Is this possible? and how?
Backstory: I'm writing a c++ console application that is listening from a socket. The end user connects to my linux device (via Windows PC usually) and can then send commands. Everything work as of now, but I want the end user to have the option of setting the default to static of dynamic at startup. They can only connect to the application if there is an IP address present. I want to add this just in case the user forgets to connect to the server if it is in dhcp mode at startup.
16.04 networking network-manager dhcp static-ip
add a comment |
up vote
0
down vote
favorite
Is there a way to set default eth0 setup in linux. I know I can give it a default static IP at boot up with sudo ip route add default via 10.0.0.1 dev eth0
. Is there a way to change it to DHCP at bootup. AND if it's in DHCP but I do NOT have my ethernet cable connected to the network, I want it to be set to an IP address so that it always has a way to be able to connect to it at bootup without any extra commands from the terminal. So.... a default IP address if a DHCP address is not found. Is this possible? and how?
Backstory: I'm writing a c++ console application that is listening from a socket. The end user connects to my linux device (via Windows PC usually) and can then send commands. Everything work as of now, but I want the end user to have the option of setting the default to static of dynamic at startup. They can only connect to the application if there is an IP address present. I want to add this just in case the user forgets to connect to the server if it is in dhcp mode at startup.
16.04 networking network-manager dhcp static-ip
Related SO Q&A: stackoverflow.com/q/12727175/1531971
– jdv
3 hours ago
Thanks! But is there a way to have dhcp as default if I've already made static my default? A toggle between both that I can add to my code. For static default, I send the command in my question. For dynamic, is there a terminal command to do the same?
– miceandmon
3 hours ago
There is a fixed Ask Ubuntu networking page somewhere that may answer that.
– jdv
3 hours ago
oh ok. Got it. Thank you!!
– miceandmon
3 hours ago
If you find an actual answer to your question (or if it is answered elsewhere) make sure circle back here and let us know so future folks can benefit...
– jdv
2 hours ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Is there a way to set default eth0 setup in linux. I know I can give it a default static IP at boot up with sudo ip route add default via 10.0.0.1 dev eth0
. Is there a way to change it to DHCP at bootup. AND if it's in DHCP but I do NOT have my ethernet cable connected to the network, I want it to be set to an IP address so that it always has a way to be able to connect to it at bootup without any extra commands from the terminal. So.... a default IP address if a DHCP address is not found. Is this possible? and how?
Backstory: I'm writing a c++ console application that is listening from a socket. The end user connects to my linux device (via Windows PC usually) and can then send commands. Everything work as of now, but I want the end user to have the option of setting the default to static of dynamic at startup. They can only connect to the application if there is an IP address present. I want to add this just in case the user forgets to connect to the server if it is in dhcp mode at startup.
16.04 networking network-manager dhcp static-ip
Is there a way to set default eth0 setup in linux. I know I can give it a default static IP at boot up with sudo ip route add default via 10.0.0.1 dev eth0
. Is there a way to change it to DHCP at bootup. AND if it's in DHCP but I do NOT have my ethernet cable connected to the network, I want it to be set to an IP address so that it always has a way to be able to connect to it at bootup without any extra commands from the terminal. So.... a default IP address if a DHCP address is not found. Is this possible? and how?
Backstory: I'm writing a c++ console application that is listening from a socket. The end user connects to my linux device (via Windows PC usually) and can then send commands. Everything work as of now, but I want the end user to have the option of setting the default to static of dynamic at startup. They can only connect to the application if there is an IP address present. I want to add this just in case the user forgets to connect to the server if it is in dhcp mode at startup.
16.04 networking network-manager dhcp static-ip
16.04 networking network-manager dhcp static-ip
asked 3 hours ago
miceandmon
235
235
Related SO Q&A: stackoverflow.com/q/12727175/1531971
– jdv
3 hours ago
Thanks! But is there a way to have dhcp as default if I've already made static my default? A toggle between both that I can add to my code. For static default, I send the command in my question. For dynamic, is there a terminal command to do the same?
– miceandmon
3 hours ago
There is a fixed Ask Ubuntu networking page somewhere that may answer that.
– jdv
3 hours ago
oh ok. Got it. Thank you!!
– miceandmon
3 hours ago
If you find an actual answer to your question (or if it is answered elsewhere) make sure circle back here and let us know so future folks can benefit...
– jdv
2 hours ago
add a comment |
Related SO Q&A: stackoverflow.com/q/12727175/1531971
– jdv
3 hours ago
Thanks! But is there a way to have dhcp as default if I've already made static my default? A toggle between both that I can add to my code. For static default, I send the command in my question. For dynamic, is there a terminal command to do the same?
– miceandmon
3 hours ago
There is a fixed Ask Ubuntu networking page somewhere that may answer that.
– jdv
3 hours ago
oh ok. Got it. Thank you!!
– miceandmon
3 hours ago
If you find an actual answer to your question (or if it is answered elsewhere) make sure circle back here and let us know so future folks can benefit...
– jdv
2 hours ago
Related SO Q&A: stackoverflow.com/q/12727175/1531971
– jdv
3 hours ago
Related SO Q&A: stackoverflow.com/q/12727175/1531971
– jdv
3 hours ago
Thanks! But is there a way to have dhcp as default if I've already made static my default? A toggle between both that I can add to my code. For static default, I send the command in my question. For dynamic, is there a terminal command to do the same?
– miceandmon
3 hours ago
Thanks! But is there a way to have dhcp as default if I've already made static my default? A toggle between both that I can add to my code. For static default, I send the command in my question. For dynamic, is there a terminal command to do the same?
– miceandmon
3 hours ago
There is a fixed Ask Ubuntu networking page somewhere that may answer that.
– jdv
3 hours ago
There is a fixed Ask Ubuntu networking page somewhere that may answer that.
– jdv
3 hours ago
oh ok. Got it. Thank you!!
– miceandmon
3 hours ago
oh ok. Got it. Thank you!!
– miceandmon
3 hours ago
If you find an actual answer to your question (or if it is answered elsewhere) make sure circle back here and let us know so future folks can benefit...
– jdv
2 hours ago
If you find an actual answer to your question (or if it is answered elsewhere) make sure circle back here and let us know so future folks can benefit...
– jdv
2 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093529%2fsetting-ip-address-if-dhcp-server-fails-at-bootup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Related SO Q&A: stackoverflow.com/q/12727175/1531971
– jdv
3 hours ago
Thanks! But is there a way to have dhcp as default if I've already made static my default? A toggle between both that I can add to my code. For static default, I send the command in my question. For dynamic, is there a terminal command to do the same?
– miceandmon
3 hours ago
There is a fixed Ask Ubuntu networking page somewhere that may answer that.
– jdv
3 hours ago
oh ok. Got it. Thank you!!
– miceandmon
3 hours ago
If you find an actual answer to your question (or if it is answered elsewhere) make sure circle back here and let us know so future folks can benefit...
– jdv
2 hours ago