Determine if it's a static IP or a DHCP IP
up vote
1
down vote
favorite
I'm trying to find a genric solution across all linux distro to find if the IP address attached to the system is a static or a DHCP ?
On ubuntu , I can find if it's static or DHCP by doing a DHCP grep on /var/log/syslog
but it is not generic solution , it might differ on other platforms.
One of the target board is Cortina and I'm using open wrt as a boot up kernel for that. There is no var/log/syslog
on Cortina nothing similar to that also.
linux networking ubuntu dhcp
add a comment |
up vote
1
down vote
favorite
I'm trying to find a genric solution across all linux distro to find if the IP address attached to the system is a static or a DHCP ?
On ubuntu , I can find if it's static or DHCP by doing a DHCP grep on /var/log/syslog
but it is not generic solution , it might differ on other platforms.
One of the target board is Cortina and I'm using open wrt as a boot up kernel for that. There is no var/log/syslog
on Cortina nothing similar to that also.
linux networking ubuntu dhcp
If youifconfig <your_interface>
and look at the flags listed, you may be able to find "DHCP" - this may be a little more generic across distros
– Kinnectus
Aug 12 '15 at 8:35
@BigChris ifconfig interface doesn't display anything about the type of connection :/
– Neetz
Aug 12 '15 at 9:21
In that case there's no method universal across all linux distros. There is a syslog on openwrt though which will tell you this though. It's just not a file.
– qasdfdsaq
Aug 12 '15 at 10:26
I only did a quick look up and came across this resource: unix.com/unix-for-dummies-questions-and-answers/…
– Kinnectus
Aug 12 '15 at 10:39
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to find a genric solution across all linux distro to find if the IP address attached to the system is a static or a DHCP ?
On ubuntu , I can find if it's static or DHCP by doing a DHCP grep on /var/log/syslog
but it is not generic solution , it might differ on other platforms.
One of the target board is Cortina and I'm using open wrt as a boot up kernel for that. There is no var/log/syslog
on Cortina nothing similar to that also.
linux networking ubuntu dhcp
I'm trying to find a genric solution across all linux distro to find if the IP address attached to the system is a static or a DHCP ?
On ubuntu , I can find if it's static or DHCP by doing a DHCP grep on /var/log/syslog
but it is not generic solution , it might differ on other platforms.
One of the target board is Cortina and I'm using open wrt as a boot up kernel for that. There is no var/log/syslog
on Cortina nothing similar to that also.
linux networking ubuntu dhcp
linux networking ubuntu dhcp
edited Aug 12 '15 at 8:07
WaQaR Ali
1156
1156
asked Aug 12 '15 at 7:29
Neetz
1516
1516
If youifconfig <your_interface>
and look at the flags listed, you may be able to find "DHCP" - this may be a little more generic across distros
– Kinnectus
Aug 12 '15 at 8:35
@BigChris ifconfig interface doesn't display anything about the type of connection :/
– Neetz
Aug 12 '15 at 9:21
In that case there's no method universal across all linux distros. There is a syslog on openwrt though which will tell you this though. It's just not a file.
– qasdfdsaq
Aug 12 '15 at 10:26
I only did a quick look up and came across this resource: unix.com/unix-for-dummies-questions-and-answers/…
– Kinnectus
Aug 12 '15 at 10:39
add a comment |
If youifconfig <your_interface>
and look at the flags listed, you may be able to find "DHCP" - this may be a little more generic across distros
– Kinnectus
Aug 12 '15 at 8:35
@BigChris ifconfig interface doesn't display anything about the type of connection :/
– Neetz
Aug 12 '15 at 9:21
In that case there's no method universal across all linux distros. There is a syslog on openwrt though which will tell you this though. It's just not a file.
– qasdfdsaq
Aug 12 '15 at 10:26
I only did a quick look up and came across this resource: unix.com/unix-for-dummies-questions-and-answers/…
– Kinnectus
Aug 12 '15 at 10:39
If you
ifconfig <your_interface>
and look at the flags listed, you may be able to find "DHCP" - this may be a little more generic across distros– Kinnectus
Aug 12 '15 at 8:35
If you
ifconfig <your_interface>
and look at the flags listed, you may be able to find "DHCP" - this may be a little more generic across distros– Kinnectus
Aug 12 '15 at 8:35
@BigChris ifconfig interface doesn't display anything about the type of connection :/
– Neetz
Aug 12 '15 at 9:21
@BigChris ifconfig interface doesn't display anything about the type of connection :/
– Neetz
Aug 12 '15 at 9:21
In that case there's no method universal across all linux distros. There is a syslog on openwrt though which will tell you this though. It's just not a file.
– qasdfdsaq
Aug 12 '15 at 10:26
In that case there's no method universal across all linux distros. There is a syslog on openwrt though which will tell you this though. It's just not a file.
– qasdfdsaq
Aug 12 '15 at 10:26
I only did a quick look up and came across this resource: unix.com/unix-for-dummies-questions-and-answers/…
– Kinnectus
Aug 12 '15 at 10:39
I only did a quick look up and came across this resource: unix.com/unix-for-dummies-questions-and-answers/…
– Kinnectus
Aug 12 '15 at 10:39
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
The problem is, if you're using NetworkManager, for example, it's going to be requesting an IP and gateway and DNS server. But beyond that, once it's got the information it needs, it sets addressing information essentially statically. Essentially, the rest of your machine doesn't know or care if an address is static or dynamic, just that it has an address.
You can check /var/log/syslog
for DHCPACK entries specifically. I believe dhclient and NetworkManager write there.
add a comment |
up vote
1
down vote
Type in terminal
cat /etc/network/interfaces
You should find one of this lines
iface eth0 inet dhcp
that means that IP for interface eth0 is from DHCP
iface eth0 inet static
Above line shows that IP is static. You should also find other parameters.
1
What does it mean if the result isiface lo inet loopback
?
– Magick
Feb 22 at 1:42
add a comment |
up vote
0
down vote
If its CentOS, you can check /etc/sysconfig/network-scripts/ifcfg-eth0. Check BOOTPROTO entry says. If its dhcp then its DHCP configured. If its Static or none, then its not DHCP
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The problem is, if you're using NetworkManager, for example, it's going to be requesting an IP and gateway and DNS server. But beyond that, once it's got the information it needs, it sets addressing information essentially statically. Essentially, the rest of your machine doesn't know or care if an address is static or dynamic, just that it has an address.
You can check /var/log/syslog
for DHCPACK entries specifically. I believe dhclient and NetworkManager write there.
add a comment |
up vote
1
down vote
The problem is, if you're using NetworkManager, for example, it's going to be requesting an IP and gateway and DNS server. But beyond that, once it's got the information it needs, it sets addressing information essentially statically. Essentially, the rest of your machine doesn't know or care if an address is static or dynamic, just that it has an address.
You can check /var/log/syslog
for DHCPACK entries specifically. I believe dhclient and NetworkManager write there.
add a comment |
up vote
1
down vote
up vote
1
down vote
The problem is, if you're using NetworkManager, for example, it's going to be requesting an IP and gateway and DNS server. But beyond that, once it's got the information it needs, it sets addressing information essentially statically. Essentially, the rest of your machine doesn't know or care if an address is static or dynamic, just that it has an address.
You can check /var/log/syslog
for DHCPACK entries specifically. I believe dhclient and NetworkManager write there.
The problem is, if you're using NetworkManager, for example, it's going to be requesting an IP and gateway and DNS server. But beyond that, once it's got the information it needs, it sets addressing information essentially statically. Essentially, the rest of your machine doesn't know or care if an address is static or dynamic, just that it has an address.
You can check /var/log/syslog
for DHCPACK entries specifically. I believe dhclient and NetworkManager write there.
answered Aug 15 '15 at 21:52
hlmtre
314
314
add a comment |
add a comment |
up vote
1
down vote
Type in terminal
cat /etc/network/interfaces
You should find one of this lines
iface eth0 inet dhcp
that means that IP for interface eth0 is from DHCP
iface eth0 inet static
Above line shows that IP is static. You should also find other parameters.
1
What does it mean if the result isiface lo inet loopback
?
– Magick
Feb 22 at 1:42
add a comment |
up vote
1
down vote
Type in terminal
cat /etc/network/interfaces
You should find one of this lines
iface eth0 inet dhcp
that means that IP for interface eth0 is from DHCP
iface eth0 inet static
Above line shows that IP is static. You should also find other parameters.
1
What does it mean if the result isiface lo inet loopback
?
– Magick
Feb 22 at 1:42
add a comment |
up vote
1
down vote
up vote
1
down vote
Type in terminal
cat /etc/network/interfaces
You should find one of this lines
iface eth0 inet dhcp
that means that IP for interface eth0 is from DHCP
iface eth0 inet static
Above line shows that IP is static. You should also find other parameters.
Type in terminal
cat /etc/network/interfaces
You should find one of this lines
iface eth0 inet dhcp
that means that IP for interface eth0 is from DHCP
iface eth0 inet static
Above line shows that IP is static. You should also find other parameters.
answered Sep 16 '16 at 9:20
GarryMoveOut
112
112
1
What does it mean if the result isiface lo inet loopback
?
– Magick
Feb 22 at 1:42
add a comment |
1
What does it mean if the result isiface lo inet loopback
?
– Magick
Feb 22 at 1:42
1
1
What does it mean if the result is
iface lo inet loopback
?– Magick
Feb 22 at 1:42
What does it mean if the result is
iface lo inet loopback
?– Magick
Feb 22 at 1:42
add a comment |
up vote
0
down vote
If its CentOS, you can check /etc/sysconfig/network-scripts/ifcfg-eth0. Check BOOTPROTO entry says. If its dhcp then its DHCP configured. If its Static or none, then its not DHCP
add a comment |
up vote
0
down vote
If its CentOS, you can check /etc/sysconfig/network-scripts/ifcfg-eth0. Check BOOTPROTO entry says. If its dhcp then its DHCP configured. If its Static or none, then its not DHCP
add a comment |
up vote
0
down vote
up vote
0
down vote
If its CentOS, you can check /etc/sysconfig/network-scripts/ifcfg-eth0. Check BOOTPROTO entry says. If its dhcp then its DHCP configured. If its Static or none, then its not DHCP
If its CentOS, you can check /etc/sysconfig/network-scripts/ifcfg-eth0. Check BOOTPROTO entry says. If its dhcp then its DHCP configured. If its Static or none, then its not DHCP
answered Nov 29 at 6:53
Chandrasekar
21125
21125
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2fsuperuser.com%2fquestions%2f955790%2fdetermine-if-its-a-static-ip-or-a-dhcp-ip%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
If you
ifconfig <your_interface>
and look at the flags listed, you may be able to find "DHCP" - this may be a little more generic across distros– Kinnectus
Aug 12 '15 at 8:35
@BigChris ifconfig interface doesn't display anything about the type of connection :/
– Neetz
Aug 12 '15 at 9:21
In that case there's no method universal across all linux distros. There is a syslog on openwrt though which will tell you this though. It's just not a file.
– qasdfdsaq
Aug 12 '15 at 10:26
I only did a quick look up and came across this resource: unix.com/unix-for-dummies-questions-and-answers/…
– Kinnectus
Aug 12 '15 at 10:39