traceroute, only print gateway information
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I can't find any info regarding this in the man-pages. How would one go about only printing the gateway using traceroute?
ubuntu terminal traceroute
 |Â
show 1 more comment
up vote
3
down vote
favorite
I can't find any info regarding this in the man-pages. How would one go about only printing the gateway using traceroute?
ubuntu terminal traceroute
would you clarify the question? it is not entirely clear what your need is. Maybe an example?
â Rui F Ribeiro
Nov 28 '17 at 21:30
@RuiFRibeiro Basically I'm looking for a way to use traceroute to only print one line. That line being the one containing the gateway information, nothing else.
â Lithicas
Nov 28 '17 at 21:33
anything against netstat -nr? I think what you want with traceroute can be done, will check it out and will come back.
â Rui F Ribeiro
Nov 28 '17 at 21:35
@RuiFRibeiro I appreciate your help. Nothing against netstat -nr. It's only that it's a school assignment that requires me to use traceroute. I've read the man-pages but haven't found a flag that does what I want, apparently it is possible though.
â Lithicas
Nov 28 '17 at 21:37
1
You should read about e.g.grep
,sed
andawk
and how they can be used to cut out lines fromtraceroute
's output.
â dessert
Nov 28 '17 at 21:39
 |Â
show 1 more comment
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I can't find any info regarding this in the man-pages. How would one go about only printing the gateway using traceroute?
ubuntu terminal traceroute
I can't find any info regarding this in the man-pages. How would one go about only printing the gateway using traceroute?
ubuntu terminal traceroute
asked Nov 28 '17 at 21:28
Lithicas
1183
1183
would you clarify the question? it is not entirely clear what your need is. Maybe an example?
â Rui F Ribeiro
Nov 28 '17 at 21:30
@RuiFRibeiro Basically I'm looking for a way to use traceroute to only print one line. That line being the one containing the gateway information, nothing else.
â Lithicas
Nov 28 '17 at 21:33
anything against netstat -nr? I think what you want with traceroute can be done, will check it out and will come back.
â Rui F Ribeiro
Nov 28 '17 at 21:35
@RuiFRibeiro I appreciate your help. Nothing against netstat -nr. It's only that it's a school assignment that requires me to use traceroute. I've read the man-pages but haven't found a flag that does what I want, apparently it is possible though.
â Lithicas
Nov 28 '17 at 21:37
1
You should read about e.g.grep
,sed
andawk
and how they can be used to cut out lines fromtraceroute
's output.
â dessert
Nov 28 '17 at 21:39
 |Â
show 1 more comment
would you clarify the question? it is not entirely clear what your need is. Maybe an example?
â Rui F Ribeiro
Nov 28 '17 at 21:30
@RuiFRibeiro Basically I'm looking for a way to use traceroute to only print one line. That line being the one containing the gateway information, nothing else.
â Lithicas
Nov 28 '17 at 21:33
anything against netstat -nr? I think what you want with traceroute can be done, will check it out and will come back.
â Rui F Ribeiro
Nov 28 '17 at 21:35
@RuiFRibeiro I appreciate your help. Nothing against netstat -nr. It's only that it's a school assignment that requires me to use traceroute. I've read the man-pages but haven't found a flag that does what I want, apparently it is possible though.
â Lithicas
Nov 28 '17 at 21:37
1
You should read about e.g.grep
,sed
andawk
and how they can be used to cut out lines fromtraceroute
's output.
â dessert
Nov 28 '17 at 21:39
would you clarify the question? it is not entirely clear what your need is. Maybe an example?
â Rui F Ribeiro
Nov 28 '17 at 21:30
would you clarify the question? it is not entirely clear what your need is. Maybe an example?
â Rui F Ribeiro
Nov 28 '17 at 21:30
@RuiFRibeiro Basically I'm looking for a way to use traceroute to only print one line. That line being the one containing the gateway information, nothing else.
â Lithicas
Nov 28 '17 at 21:33
@RuiFRibeiro Basically I'm looking for a way to use traceroute to only print one line. That line being the one containing the gateway information, nothing else.
â Lithicas
Nov 28 '17 at 21:33
anything against netstat -nr? I think what you want with traceroute can be done, will check it out and will come back.
â Rui F Ribeiro
Nov 28 '17 at 21:35
anything against netstat -nr? I think what you want with traceroute can be done, will check it out and will come back.
â Rui F Ribeiro
Nov 28 '17 at 21:35
@RuiFRibeiro I appreciate your help. Nothing against netstat -nr. It's only that it's a school assignment that requires me to use traceroute. I've read the man-pages but haven't found a flag that does what I want, apparently it is possible though.
â Lithicas
Nov 28 '17 at 21:37
@RuiFRibeiro I appreciate your help. Nothing against netstat -nr. It's only that it's a school assignment that requires me to use traceroute. I've read the man-pages but haven't found a flag that does what I want, apparently it is possible though.
â Lithicas
Nov 28 '17 at 21:37
1
1
You should read about e.g.
grep
, sed
and awk
and how they can be used to cut out lines from traceroute
's output.â dessert
Nov 28 '17 at 21:39
You should read about e.g.
grep
, sed
and awk
and how they can be used to cut out lines from traceroute
's output.â dessert
Nov 28 '17 at 21:39
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
With traceroute
you've to enter maximum hop
as 1 using m1
option as follows.
traceroute -m1 google.com
According to basic rules of computer network Gateway and host must be connected to same NIC
of router. Otherwise Data Link Layer will unable to deliver packets from hosts to Gateway. So it's hop
should be 1.
So by setting maximum hop as one and tracing any host will prit Gateway only.
1
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
1
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
With traceroute
you've to enter maximum hop
as 1 using m1
option as follows.
traceroute -m1 google.com
According to basic rules of computer network Gateway and host must be connected to same NIC
of router. Otherwise Data Link Layer will unable to deliver packets from hosts to Gateway. So it's hop
should be 1.
So by setting maximum hop as one and tracing any host will prit Gateway only.
1
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
1
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
add a comment |Â
up vote
4
down vote
accepted
With traceroute
you've to enter maximum hop
as 1 using m1
option as follows.
traceroute -m1 google.com
According to basic rules of computer network Gateway and host must be connected to same NIC
of router. Otherwise Data Link Layer will unable to deliver packets from hosts to Gateway. So it's hop
should be 1.
So by setting maximum hop as one and tracing any host will prit Gateway only.
1
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
1
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
With traceroute
you've to enter maximum hop
as 1 using m1
option as follows.
traceroute -m1 google.com
According to basic rules of computer network Gateway and host must be connected to same NIC
of router. Otherwise Data Link Layer will unable to deliver packets from hosts to Gateway. So it's hop
should be 1.
So by setting maximum hop as one and tracing any host will prit Gateway only.
With traceroute
you've to enter maximum hop
as 1 using m1
option as follows.
traceroute -m1 google.com
According to basic rules of computer network Gateway and host must be connected to same NIC
of router. Otherwise Data Link Layer will unable to deliver packets from hosts to Gateway. So it's hop
should be 1.
So by setting maximum hop as one and tracing any host will prit Gateway only.
edited Nov 29 '17 at 7:35
answered Nov 28 '17 at 21:45
Abhik Bose
1,5341217
1,5341217
1
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
1
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
add a comment |Â
1
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
1
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
1
1
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
indeed, you beat me to it ; as an additional curiosity, the max limit is 64 hops.
â Rui F Ribeiro
Nov 28 '17 at 21:46
1
1
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Brilliant, thank you for your time! And thank you @RuiFRibeiro for you help too!
â Lithicas
Nov 28 '17 at 21:48
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
Really good question.. Liked it
â Abhik Bose
Nov 28 '17 at 21:54
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407596%2ftraceroute-only-print-gateway-information%23new-answer', 'question_page');
);
Post as a guest
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
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
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
would you clarify the question? it is not entirely clear what your need is. Maybe an example?
â Rui F Ribeiro
Nov 28 '17 at 21:30
@RuiFRibeiro Basically I'm looking for a way to use traceroute to only print one line. That line being the one containing the gateway information, nothing else.
â Lithicas
Nov 28 '17 at 21:33
anything against netstat -nr? I think what you want with traceroute can be done, will check it out and will come back.
â Rui F Ribeiro
Nov 28 '17 at 21:35
@RuiFRibeiro I appreciate your help. Nothing against netstat -nr. It's only that it's a school assignment that requires me to use traceroute. I've read the man-pages but haven't found a flag that does what I want, apparently it is possible though.
â Lithicas
Nov 28 '17 at 21:37
1
You should read about e.g.
grep
,sed
andawk
and how they can be used to cut out lines fromtraceroute
's output.â dessert
Nov 28 '17 at 21:39