Find the interface a subnet is going out on a router

I want to know how to find the interface a subnet's traffic is leaving on a router for example:
Who is Participating?
rauenpcConnect With a Mentor Commented:
If the above command responds with "subnet does not exist" use the command
Show ip route longer-prefix

Substitute network and mask with whatever you're looking for. If there are no routes, it will show you your gateway of last resort.
Is it a consumer grade, i.e. home router or is it cisco, juniper etc router?
If it's a cisco router you can do:

show ip route

and it will show you the outgoing interface and ip address of the next hop
dsterlingAuthor Commented:
Comments are great, but I don't see a route and it's not showing the gateway of last resort, could that be the gateway of last resort is not set? It does have a default-gateway IP?

Which router do you have?
Is ip routing enabled?
Please can you post a sanitised version of the configuration.
Normally the default-gateway command is only used if a router is only being used as a bridge.
ip route
Is the normal method to set the default gateway where is the gateway to the rest of the network/internet.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.