How to get the IPV4 address for an interface from /proc
Clash Royale CLAN TAG#URR8PPP
Is there a clean, simple way to get an IP address for a network interface from /proc
, similar to the way I can get the MAC address for a network interface?
Ideally I would just type cat /proc/<foo>/interface_name
and get the IPv4 address.
I'd rather not run anything other than cat
.
linux ip proc
add a comment |
Is there a clean, simple way to get an IP address for a network interface from /proc
, similar to the way I can get the MAC address for a network interface?
Ideally I would just type cat /proc/<foo>/interface_name
and get the IPv4 address.
I'd rather not run anything other than cat
.
linux ip proc
add a comment |
Is there a clean, simple way to get an IP address for a network interface from /proc
, similar to the way I can get the MAC address for a network interface?
Ideally I would just type cat /proc/<foo>/interface_name
and get the IPv4 address.
I'd rather not run anything other than cat
.
linux ip proc
Is there a clean, simple way to get an IP address for a network interface from /proc
, similar to the way I can get the MAC address for a network interface?
Ideally I would just type cat /proc/<foo>/interface_name
and get the IPv4 address.
I'd rather not run anything other than cat
.
linux ip proc
linux ip proc
edited Feb 26 at 13:25
fra-san
1,8751620
1,8751620
asked May 15 '17 at 17:53
razehrazeh
196114
196114
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Under the /proc
directory, you can also find the IPv4 addresses in the Forwarding Information Base table, at /proc/net/fib_trie
The table is pretty intelligible doing a mere cat
, first comes the Main:
and then Local:
cat /proc/net/fib_trie
or to see your network, IP addresses and netmask:
cat /proc/net/fib_trie | grep "|--" | egrep -v "0.0.0.0| 127."
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
1
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
1
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work
– villapx
May 15 '17 at 18:47
1
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
|
show 5 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2funix.stackexchange.com%2fquestions%2f365225%2fhow-to-get-the-ipv4-address-for-an-interface-from-proc%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Under the /proc
directory, you can also find the IPv4 addresses in the Forwarding Information Base table, at /proc/net/fib_trie
The table is pretty intelligible doing a mere cat
, first comes the Main:
and then Local:
cat /proc/net/fib_trie
or to see your network, IP addresses and netmask:
cat /proc/net/fib_trie | grep "|--" | egrep -v "0.0.0.0| 127."
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
1
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
1
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work
– villapx
May 15 '17 at 18:47
1
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
|
show 5 more comments
Under the /proc
directory, you can also find the IPv4 addresses in the Forwarding Information Base table, at /proc/net/fib_trie
The table is pretty intelligible doing a mere cat
, first comes the Main:
and then Local:
cat /proc/net/fib_trie
or to see your network, IP addresses and netmask:
cat /proc/net/fib_trie | grep "|--" | egrep -v "0.0.0.0| 127."
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
1
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
1
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work
– villapx
May 15 '17 at 18:47
1
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
|
show 5 more comments
Under the /proc
directory, you can also find the IPv4 addresses in the Forwarding Information Base table, at /proc/net/fib_trie
The table is pretty intelligible doing a mere cat
, first comes the Main:
and then Local:
cat /proc/net/fib_trie
or to see your network, IP addresses and netmask:
cat /proc/net/fib_trie | grep "|--" | egrep -v "0.0.0.0| 127."
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
Under the /proc
directory, you can also find the IPv4 addresses in the Forwarding Information Base table, at /proc/net/fib_trie
The table is pretty intelligible doing a mere cat
, first comes the Main:
and then Local:
cat /proc/net/fib_trie
or to see your network, IP addresses and netmask:
cat /proc/net/fib_trie | grep "|--" | egrep -v "0.0.0.0| 127."
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
|-- 193.136.1.0
|-- 193.136.1.2
|-- 193.136.1.255
edited Feb 22 '18 at 8:46
answered May 15 '17 at 18:16
Rui F RibeiroRui F Ribeiro
41.7k1483141
41.7k1483141
1
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
1
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work
– villapx
May 15 '17 at 18:47
1
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
|
show 5 more comments
1
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
1
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work
– villapx
May 15 '17 at 18:47
1
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
1
1
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
Is there a way to get the interface for each IP address?
– razeh
May 15 '17 at 18:18
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
They appear in a pre-determined order; probably priority, but that can be changed; other than that, no.
– Rui F Ribeiro
May 15 '17 at 18:27
1
1
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work– villapx
May 15 '17 at 18:47
/proc/net/fib_trie
isn't available on my RHEL 6.6 system here at work– villapx
May 15 '17 at 18:47
1
1
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
@villapx fib_trie is not present on 2.6 kernels.
– Rui F Ribeiro
Sep 27 '18 at 15:07
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
There's no way to associate ip addresses with interface in fib_trie.
– ZioByte
Mar 10 at 21:38
|
show 5 more comments
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f365225%2fhow-to-get-the-ipv4-address-for-an-interface-from-proc%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