How to find out which network device is used to reach a given server











up vote
1
down vote

favorite












I have an overly complicated developer network setup with Ethernet, WLAN and VPN.



I can connect to certain server but I need to know which actual network device / router was used to make the connection. Depending on which network is used certain ports might be blocked and I have a suspicion the connection isn't going the way it should.



I use macOS but I'm fine terminal commands and have most of the gnu tools installed via MacPorts.










share|improve this question






















  • On Windows this is done with tracert <destination name or IP>. You'll be shown the address of every router along the route. Not sure what the equivalent is on MacOS.
    – Twisty Impersonator
    Nov 19 at 10:59










  • Does macOS by chance have route -4 get <ip> / route -6 get <ip> (as in FreeBSD)?
    – grawity
    Nov 19 at 11:30















up vote
1
down vote

favorite












I have an overly complicated developer network setup with Ethernet, WLAN and VPN.



I can connect to certain server but I need to know which actual network device / router was used to make the connection. Depending on which network is used certain ports might be blocked and I have a suspicion the connection isn't going the way it should.



I use macOS but I'm fine terminal commands and have most of the gnu tools installed via MacPorts.










share|improve this question






















  • On Windows this is done with tracert <destination name or IP>. You'll be shown the address of every router along the route. Not sure what the equivalent is on MacOS.
    – Twisty Impersonator
    Nov 19 at 10:59










  • Does macOS by chance have route -4 get <ip> / route -6 get <ip> (as in FreeBSD)?
    – grawity
    Nov 19 at 11:30













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have an overly complicated developer network setup with Ethernet, WLAN and VPN.



I can connect to certain server but I need to know which actual network device / router was used to make the connection. Depending on which network is used certain ports might be blocked and I have a suspicion the connection isn't going the way it should.



I use macOS but I'm fine terminal commands and have most of the gnu tools installed via MacPorts.










share|improve this question













I have an overly complicated developer network setup with Ethernet, WLAN and VPN.



I can connect to certain server but I need to know which actual network device / router was used to make the connection. Depending on which network is used certain ports might be blocked and I have a suspicion the connection isn't going the way it should.



I use macOS but I'm fine terminal commands and have most of the gnu tools installed via MacPorts.







networking macos vpn routing traceroute






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 at 10:24









Martin

232210




232210












  • On Windows this is done with tracert <destination name or IP>. You'll be shown the address of every router along the route. Not sure what the equivalent is on MacOS.
    – Twisty Impersonator
    Nov 19 at 10:59










  • Does macOS by chance have route -4 get <ip> / route -6 get <ip> (as in FreeBSD)?
    – grawity
    Nov 19 at 11:30


















  • On Windows this is done with tracert <destination name or IP>. You'll be shown the address of every router along the route. Not sure what the equivalent is on MacOS.
    – Twisty Impersonator
    Nov 19 at 10:59










  • Does macOS by chance have route -4 get <ip> / route -6 get <ip> (as in FreeBSD)?
    – grawity
    Nov 19 at 11:30
















On Windows this is done with tracert <destination name or IP>. You'll be shown the address of every router along the route. Not sure what the equivalent is on MacOS.
– Twisty Impersonator
Nov 19 at 10:59




On Windows this is done with tracert <destination name or IP>. You'll be shown the address of every router along the route. Not sure what the equivalent is on MacOS.
– Twisty Impersonator
Nov 19 at 10:59












Does macOS by chance have route -4 get <ip> / route -6 get <ip> (as in FreeBSD)?
– grawity
Nov 19 at 11:30




Does macOS by chance have route -4 get <ip> / route -6 get <ip> (as in FreeBSD)?
– grawity
Nov 19 at 11:30










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










You can use route get 8.8.8.8 to find out which interface and gateway on the local computer is used according to the local routing rules. The -4 and -6 options as on BSD don't work, but the -n option for numerical output does work.



You can also use traceroute 8.8.8.8 to find out the intermediate routers on the path (with the usual caveats when doing a traceroute).



Edit



8.8.8.8 stands of course for the IP address you want to reach, it needn't be literally 8.8.8.8.






share|improve this answer



















  • 1




    Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
    – Twisty Impersonator
    Nov 19 at 12:51










  • Thanks. route get gave me the output i needed and was able to fix the problem,
    – Martin
    Nov 19 at 16:16










  • alternative to traceroute => mtr
    – Hannu
    Nov 19 at 17:12











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376658%2fhow-to-find-out-which-network-device-is-used-to-reach-a-given-server%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








up vote
3
down vote



accepted










You can use route get 8.8.8.8 to find out which interface and gateway on the local computer is used according to the local routing rules. The -4 and -6 options as on BSD don't work, but the -n option for numerical output does work.



You can also use traceroute 8.8.8.8 to find out the intermediate routers on the path (with the usual caveats when doing a traceroute).



Edit



8.8.8.8 stands of course for the IP address you want to reach, it needn't be literally 8.8.8.8.






share|improve this answer



















  • 1




    Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
    – Twisty Impersonator
    Nov 19 at 12:51










  • Thanks. route get gave me the output i needed and was able to fix the problem,
    – Martin
    Nov 19 at 16:16










  • alternative to traceroute => mtr
    – Hannu
    Nov 19 at 17:12















up vote
3
down vote



accepted










You can use route get 8.8.8.8 to find out which interface and gateway on the local computer is used according to the local routing rules. The -4 and -6 options as on BSD don't work, but the -n option for numerical output does work.



You can also use traceroute 8.8.8.8 to find out the intermediate routers on the path (with the usual caveats when doing a traceroute).



Edit



8.8.8.8 stands of course for the IP address you want to reach, it needn't be literally 8.8.8.8.






share|improve this answer



















  • 1




    Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
    – Twisty Impersonator
    Nov 19 at 12:51










  • Thanks. route get gave me the output i needed and was able to fix the problem,
    – Martin
    Nov 19 at 16:16










  • alternative to traceroute => mtr
    – Hannu
    Nov 19 at 17:12













up vote
3
down vote



accepted







up vote
3
down vote



accepted






You can use route get 8.8.8.8 to find out which interface and gateway on the local computer is used according to the local routing rules. The -4 and -6 options as on BSD don't work, but the -n option for numerical output does work.



You can also use traceroute 8.8.8.8 to find out the intermediate routers on the path (with the usual caveats when doing a traceroute).



Edit



8.8.8.8 stands of course for the IP address you want to reach, it needn't be literally 8.8.8.8.






share|improve this answer














You can use route get 8.8.8.8 to find out which interface and gateway on the local computer is used according to the local routing rules. The -4 and -6 options as on BSD don't work, but the -n option for numerical output does work.



You can also use traceroute 8.8.8.8 to find out the intermediate routers on the path (with the usual caveats when doing a traceroute).



Edit



8.8.8.8 stands of course for the IP address you want to reach, it needn't be literally 8.8.8.8.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 19 at 13:05

























answered Nov 19 at 11:55









dirkt

8,59331121




8,59331121








  • 1




    Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
    – Twisty Impersonator
    Nov 19 at 12:51










  • Thanks. route get gave me the output i needed and was able to fix the problem,
    – Martin
    Nov 19 at 16:16










  • alternative to traceroute => mtr
    – Hannu
    Nov 19 at 17:12














  • 1




    Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
    – Twisty Impersonator
    Nov 19 at 12:51










  • Thanks. route get gave me the output i needed and was able to fix the problem,
    – Martin
    Nov 19 at 16:16










  • alternative to traceroute => mtr
    – Hannu
    Nov 19 at 17:12








1




1




Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
– Twisty Impersonator
Nov 19 at 12:51




Or in the case of an internal routing issue, substitute 8.8.8.8 with the IP of your internal target host.
– Twisty Impersonator
Nov 19 at 12:51












Thanks. route get gave me the output i needed and was able to fix the problem,
– Martin
Nov 19 at 16:16




Thanks. route get gave me the output i needed and was able to fix the problem,
– Martin
Nov 19 at 16:16












alternative to traceroute => mtr
– Hannu
Nov 19 at 17:12




alternative to traceroute => mtr
– Hannu
Nov 19 at 17:12


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376658%2fhow-to-find-out-which-network-device-is-used-to-reach-a-given-server%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa