How do I know what Interface is my public interface?how to set what route would be added when bringing...
What is the reason behind water not falling from a bucket at the top of loop?
Need reasons why a satellite network would not work
“The Fourier transform cannot measure two phases at the same frequency.” Why not?
Probably terminated or laid off soon; confront or not?
Single flight multiple flight numbers?
A verb for when some rights are not violated?
Why do dragons like shiny stuff?
What do "unsettled funds" mean?
Pronouns when writing from the point of view of a robot
Why are there yellow dot stickers on the front doors of businesses in Russia?
Did Logical Positivism fail because it simply denied human emotion?
Is it uncompelling to continue the story with lower stakes?
Plotting Autoregressive Functions / Linear Difference Equations
Getting Lost in the Caves of Chaos
Is there a booking app or site that lets you specify your gender for shared dormitories?
Is the first page of a novel really that important?
Does a humanoid possessed by a ghost register as undead to a paladin's Divine Sense?
how to change dot to underline in multiple file-names?
Write The Shortest Program to Calculate Height of a Binary Tree
Would the shaking of an earthquake be visible to somebody in a low-flying aircraft?
Why is Heisenberg shown dead in Negro y Azul?
Is there a way to say "double + any number" in German?
How does Rust's 128-bit integer `i128` work on a 64-bit system?
Make lens aperture in Tikz
How do I know what Interface is my public interface?
how to set what route would be added when bringing interface up How to determine eth0 gateway address when it is not the default gateway?How to route using iproute2 not iptables?How to make wicd set dhcp-based routing?How can I forward traffic across two Ethernet cards?Direct connection Centos7 (loadbalance) to QNAP (trunk)How to get gateway information for both interface as gateway information shows as 0.0.0.0NAT ETH1 PORT 5000 Traffic to PPP0Configuring Linux Mint as a GatewayRoute traffic to particular interface for specific port
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am setting up an application and it requires me to manually enter a public interface. When running sudo route
it gives the following result:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.55.168.1 0.0.0.0 UG 0 0 0 eth0
10.55.168.0 * 255.255.254.0 U 0 0 0 eth0
192.168.123.0 * 255.255.255.0 U 0 0 0 eth1
I can see that there are two interfaces but I am still unsure which one would be the public interface?
linux network-interface suse route
add a comment |
I am setting up an application and it requires me to manually enter a public interface. When running sudo route
it gives the following result:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.55.168.1 0.0.0.0 UG 0 0 0 eth0
10.55.168.0 * 255.255.254.0 U 0 0 0 eth0
192.168.123.0 * 255.255.255.0 U 0 0 0 eth1
I can see that there are two interfaces but I am still unsure which one would be the public interface?
linux network-interface suse route
1
Could you give more information about the application, because I don't really understand what you said as public interface. If it means the interface to reach internet it would be eth0 because it is the default route.
– migrc
Oct 21 '15 at 11:11
The application being installed opens a new can of problems. It's OpenStack Neutron, but thanks, I never seen that before that the default Destination is set to eth0
– Dean Meehan
Oct 21 '15 at 11:17
In your case it is eth0, but not always. It could be wlan0 if you have a wireless interface, for example. The default Destination defines the gateway and the interface that can reach that gateway. When you send a packet to a IP address that is not in the route table then the packet is sent to the default Destination.
– migrc
Oct 21 '15 at 11:24
add a comment |
I am setting up an application and it requires me to manually enter a public interface. When running sudo route
it gives the following result:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.55.168.1 0.0.0.0 UG 0 0 0 eth0
10.55.168.0 * 255.255.254.0 U 0 0 0 eth0
192.168.123.0 * 255.255.255.0 U 0 0 0 eth1
I can see that there are two interfaces but I am still unsure which one would be the public interface?
linux network-interface suse route
I am setting up an application and it requires me to manually enter a public interface. When running sudo route
it gives the following result:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.55.168.1 0.0.0.0 UG 0 0 0 eth0
10.55.168.0 * 255.255.254.0 U 0 0 0 eth0
192.168.123.0 * 255.255.255.0 U 0 0 0 eth1
I can see that there are two interfaces but I am still unsure which one would be the public interface?
linux network-interface suse route
linux network-interface suse route
asked Oct 21 '15 at 11:03
Dean MeehanDean Meehan
1185 bronze badges
1185 bronze badges
1
Could you give more information about the application, because I don't really understand what you said as public interface. If it means the interface to reach internet it would be eth0 because it is the default route.
– migrc
Oct 21 '15 at 11:11
The application being installed opens a new can of problems. It's OpenStack Neutron, but thanks, I never seen that before that the default Destination is set to eth0
– Dean Meehan
Oct 21 '15 at 11:17
In your case it is eth0, but not always. It could be wlan0 if you have a wireless interface, for example. The default Destination defines the gateway and the interface that can reach that gateway. When you send a packet to a IP address that is not in the route table then the packet is sent to the default Destination.
– migrc
Oct 21 '15 at 11:24
add a comment |
1
Could you give more information about the application, because I don't really understand what you said as public interface. If it means the interface to reach internet it would be eth0 because it is the default route.
– migrc
Oct 21 '15 at 11:11
The application being installed opens a new can of problems. It's OpenStack Neutron, but thanks, I never seen that before that the default Destination is set to eth0
– Dean Meehan
Oct 21 '15 at 11:17
In your case it is eth0, but not always. It could be wlan0 if you have a wireless interface, for example. The default Destination defines the gateway and the interface that can reach that gateway. When you send a packet to a IP address that is not in the route table then the packet is sent to the default Destination.
– migrc
Oct 21 '15 at 11:24
1
1
Could you give more information about the application, because I don't really understand what you said as public interface. If it means the interface to reach internet it would be eth0 because it is the default route.
– migrc
Oct 21 '15 at 11:11
Could you give more information about the application, because I don't really understand what you said as public interface. If it means the interface to reach internet it would be eth0 because it is the default route.
– migrc
Oct 21 '15 at 11:11
The application being installed opens a new can of problems. It's OpenStack Neutron, but thanks, I never seen that before that the default Destination is set to eth0
– Dean Meehan
Oct 21 '15 at 11:17
The application being installed opens a new can of problems. It's OpenStack Neutron, but thanks, I never seen that before that the default Destination is set to eth0
– Dean Meehan
Oct 21 '15 at 11:17
In your case it is eth0, but not always. It could be wlan0 if you have a wireless interface, for example. The default Destination defines the gateway and the interface that can reach that gateway. When you send a packet to a IP address that is not in the route table then the packet is sent to the default Destination.
– migrc
Oct 21 '15 at 11:24
In your case it is eth0, but not always. It could be wlan0 if you have a wireless interface, for example. The default Destination defines the gateway and the interface that can reach that gateway. When you send a packet to a IP address that is not in the route table then the packet is sent to the default Destination.
– migrc
Oct 21 '15 at 11:24
add a comment |
2 Answers
2
active
oldest
votes
There's no formal definition of “public interface”. The most likely definition is that it's the one where packets go if they're going out to the Internet. That would be whichever interface has the default route. On Linux, you can query it programmatically from a shell with
route -n | awk '$1 == "0.0.0.0" {print $8}'
Most Unix variants have a route
command, its command line and output syntax may be a little different.
While the default route is the only viable candidate, it may or may not actually public. Many machines are behind a NAT appliance, so they do not have a public interface at all. The NAT relays outgoing connections via its own public interface; incoming connections would reach the NAT appliance, and they wouldn't be routed to your machine unless the NAT is specifically configured to do so.
add a comment |
External interfaces are in almost all cases the one having the default route, so that will do in most cases:
ip r | awk '/^default/ {print $5}'
If you however may have several default routes with different metric values, multiple routing tables and do source or policy based routing, you should know by yourself this here is not sufficient.
add a comment |
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%2f237621%2fhow-do-i-know-what-interface-is-my-public-interface%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There's no formal definition of “public interface”. The most likely definition is that it's the one where packets go if they're going out to the Internet. That would be whichever interface has the default route. On Linux, you can query it programmatically from a shell with
route -n | awk '$1 == "0.0.0.0" {print $8}'
Most Unix variants have a route
command, its command line and output syntax may be a little different.
While the default route is the only viable candidate, it may or may not actually public. Many machines are behind a NAT appliance, so they do not have a public interface at all. The NAT relays outgoing connections via its own public interface; incoming connections would reach the NAT appliance, and they wouldn't be routed to your machine unless the NAT is specifically configured to do so.
add a comment |
There's no formal definition of “public interface”. The most likely definition is that it's the one where packets go if they're going out to the Internet. That would be whichever interface has the default route. On Linux, you can query it programmatically from a shell with
route -n | awk '$1 == "0.0.0.0" {print $8}'
Most Unix variants have a route
command, its command line and output syntax may be a little different.
While the default route is the only viable candidate, it may or may not actually public. Many machines are behind a NAT appliance, so they do not have a public interface at all. The NAT relays outgoing connections via its own public interface; incoming connections would reach the NAT appliance, and they wouldn't be routed to your machine unless the NAT is specifically configured to do so.
add a comment |
There's no formal definition of “public interface”. The most likely definition is that it's the one where packets go if they're going out to the Internet. That would be whichever interface has the default route. On Linux, you can query it programmatically from a shell with
route -n | awk '$1 == "0.0.0.0" {print $8}'
Most Unix variants have a route
command, its command line and output syntax may be a little different.
While the default route is the only viable candidate, it may or may not actually public. Many machines are behind a NAT appliance, so they do not have a public interface at all. The NAT relays outgoing connections via its own public interface; incoming connections would reach the NAT appliance, and they wouldn't be routed to your machine unless the NAT is specifically configured to do so.
There's no formal definition of “public interface”. The most likely definition is that it's the one where packets go if they're going out to the Internet. That would be whichever interface has the default route. On Linux, you can query it programmatically from a shell with
route -n | awk '$1 == "0.0.0.0" {print $8}'
Most Unix variants have a route
command, its command line and output syntax may be a little different.
While the default route is the only viable candidate, it may or may not actually public. Many machines are behind a NAT appliance, so they do not have a public interface at all. The NAT relays outgoing connections via its own public interface; incoming connections would reach the NAT appliance, and they wouldn't be routed to your machine unless the NAT is specifically configured to do so.
answered Oct 21 '15 at 19:25
GillesGilles
568k136 gold badges1168 silver badges1680 bronze badges
568k136 gold badges1168 silver badges1680 bronze badges
add a comment |
add a comment |
External interfaces are in almost all cases the one having the default route, so that will do in most cases:
ip r | awk '/^default/ {print $5}'
If you however may have several default routes with different metric values, multiple routing tables and do source or policy based routing, you should know by yourself this here is not sufficient.
add a comment |
External interfaces are in almost all cases the one having the default route, so that will do in most cases:
ip r | awk '/^default/ {print $5}'
If you however may have several default routes with different metric values, multiple routing tables and do source or policy based routing, you should know by yourself this here is not sufficient.
add a comment |
External interfaces are in almost all cases the one having the default route, so that will do in most cases:
ip r | awk '/^default/ {print $5}'
If you however may have several default routes with different metric values, multiple routing tables and do source or policy based routing, you should know by yourself this here is not sufficient.
External interfaces are in almost all cases the one having the default route, so that will do in most cases:
ip r | awk '/^default/ {print $5}'
If you however may have several default routes with different metric values, multiple routing tables and do source or policy based routing, you should know by yourself this here is not sufficient.
edited 3 hours ago
answered 3 hours ago
sjassjas
3165 silver badges8 bronze badges
3165 silver badges8 bronze badges
add a comment |
add a comment |
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%2f237621%2fhow-do-i-know-what-interface-is-my-public-interface%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
1
Could you give more information about the application, because I don't really understand what you said as public interface. If it means the interface to reach internet it would be eth0 because it is the default route.
– migrc
Oct 21 '15 at 11:11
The application being installed opens a new can of problems. It's OpenStack Neutron, but thanks, I never seen that before that the default Destination is set to eth0
– Dean Meehan
Oct 21 '15 at 11:17
In your case it is eth0, but not always. It could be wlan0 if you have a wireless interface, for example. The default Destination defines the gateway and the interface that can reach that gateway. When you send a packet to a IP address that is not in the route table then the packet is sent to the default Destination.
– migrc
Oct 21 '15 at 11:24