cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
241
Views
0
Helpful
6
Replies
Highlighted
Beginner

static routing ip route via vlan or interface is better?

Hi

 

May i know which is better? One is using vlan, the other is interface.

Personally i think interface is better because once gi0/0/1 is up, the static route will be activated. The route shld not active unless the interface is UP. This is the objective. As i know, vlan is always UP once configured.  

Is my assumption correct?

ip route 172.30.0.0 255.255.0.0 vlan300 10.1.1.1

ip route 172.30.0.0 255.255.0.0 gi0/0/1 10.1.1.1

6 REPLIES 6
Highlighted
VIP Engager

Re: static routing ip route via vlan or interface is better?

 

 - It depends on the situation, for instance on an ISP-link  you sometimes only have one outgoing routed port and no 'ongoing' vlans.  You then route via an interface to provide internet access for your intrAnet (basically).

 M.

Highlighted
Beginner

Re: static routing ip route via vlan or interface is better?

Hi,

 

ip route 172.30.0.0 255.255.0.0 gi0/0/1 10.1.1.1

Can i confirm tht for this cli, ip route only works/activated when gi0/0/1 is UP?

Highlighted
Collaborator

Re: static routing ip route via vlan or interface is better?

Hi,

 

   Yes, your below statement is correct. For "ip route 172.30.0.0 255.255.0.0 gi0/0/1 10.1.1.1" route is active as long as gi0/0/1 is UP? The scope of adding both next-hop and egress interface to a static route, is to actually create a condition for the next-hop, you're basically telling the router that that specific next-hop is valid ONLY if it's recursively reachable over that specific interface (which implies the interface is UP), otherwise the next-hop is invalid, thus the route invalid.

 

Regards,

Cristian Matei.

Highlighted
Hall of Fame Master

Re: static routing ip route via vlan or interface is better?

To provide good answers I believe that we need to understand the context of the question better. What platform is this on? Answer might depend on whether this is a router or a switch. What kind of interface is gi0/0/1? If this is an access port on a switch then static route using vlan is definitely better than using interface. If this is a routed interface then static route using interface is definitely better than using vlan.

HTH

Rick
Highlighted
Beginner

Re: static routing ip route via vlan or interface is better?

This is a vlan mode access - interface. and will be using the route via vlan. Thanks!

Highlighted
Hall of Fame Master

Re: static routing ip route via vlan or interface is better?

You are welcome.

HTH

Rick
CreatePlease to create content
Content for Community-Ad