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

Ip route vs ip default gateway

Dears kindly

we know that the ip default gateway is used for L2 switch

now if we have a layer 2 switch with ip default gateway  and we activated layer 3 functionality on it , and configured a defualt route

like this :

ip default gateway  x.x.x.x

ip route y.y.y.y

so which one will take more priority ???????

my opinion and plz correct me :  

the L3 port will use the routing table but the L2 ports will still use the ip default gateway .....

traffic in L3 port will be checked by the cef ( adjacency table ) and if it doesnt find the destination it will use the routing tabel wher the default route is installed

traffic in L2 port will be checked by the arp table and if it doesnt find the destination it will use the default gateway .

5 REPLIES 5
Highlighted
Hall of Fame Master

Hello Hamzeh,

ip default-gateway is effective when ip routing is disabled

ip route 0.0.0.0 0.0.0.0 is effective when the ip routing is enabled.

So the discriminator is the presence or absence of the command

ip routing

in global configuration mode

The behaviour changes at device level not at port level

Hope to help

Giuseppe

Highlighted

Thanx for ur reply

ok , but regarding to nexus switches ,  there is no ip default gateway command ...so what is the alternative command

other than configuring it by the dialoge

Highlighted

Hi,

U need to go ahead with IP route command.

Thanks

Highlighted

mahmood thanx my freind

but ip route will used if u are using the sw as L3 , I will use it as just L2

Highlighted

Hi

U would have been concerend if u were having other vlan interfaces on this switch which is not u r case.

So think of it like a host which is configured with ip route in order to be reachable from other subnets.

Content for Community-Ad