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:
subnet 192.168.0.0?
dsterlingAsked:
Who is Participating?
 
rauenpcConnect With a Mentor Commented:
If the above command responds with "subnet does not exist" use the command
Show ip route 192.168.0.0 255.255.255.0 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.
0
 
128bitsCommented:
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 192.168.0.0

and it will show you the outgoing interface and ip address of the next hop
0
 
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?
0
 
rochey2009Commented:
Hi,

Which router do you have?
Is ip routing enabled?
Please can you post a sanitised version of the configuration.
0
 
rauenpcCommented:
Normally the default-gateway command is only used if a router is only being used as a bridge.
ip route 0.0.0.0 0.0.0.0 1.1.1.1
Is the normal method to set the default gateway where 1.1.1.1 is the gateway to the rest of the network/internet.
0
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.