cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4104
Views
0
Helpful
8
Replies

Two different default gateway on the switch-desktop cannot access

ciscoreg2
Level 1
Level 1

Hi, guys
I have setup two different default gateway on the switch;
IP route 0.0.0.0 0.0.0.0 192.168.10.1
IP route 0.0.0.0 0.0.0.0 192.168.20.1
And I found sometimes, desktop cannot access the internet. Any know the problem?

1111.png

8 Replies 8

johnd2310
Level 8
Level 8

Hi,

Could you post the configuration of the switch and router

Thanks

John

**Please rate posts you find helpful**

I cannot access it now, so just write down related confs;
Router;
interface GigabitEthernet0/0/0
switchport mode dynamic desirable
interface Vlan10
ip address 192.168.10.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
ip tcp adjust-mss 1420
interface Vlan20
ip address 192.168.20.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
ip tcp adjust-mss 1420
ip route 0.0.0.0 0.0.0.0 Dialer1

Switch;
ip routing
interface GigabitEthernet1/0/24
switchport mode dynamic desirable
interface Vlan10
ip address 192.168.10.254 255.255.255.0
!
interface Vlan20
ip address 192.168.20.254 255.255.255.0
ip route 0.0.0.0 0.0.0.0 192.168.10.1
ip route 0.0.0.0 0.0.0.0 192.168.20.1

Hi,

 

1.  You didn't share the full configuration of Switch and Router so it is difficult to figure out the issue but seems something wrong on the switch port configuration as well:

interface GigabitEthernet1/0/24
switchport mode dynamic desirable

If this port is connected to the router then this port configuration must be like:

 

 

interface GigabitEthernet1/0/24
Description "Connected_to_Router_Gig0/0"
Switchport mode trunk
switchport trunk native vlan  10

 

And your Router interface configuration will be like (Only if Router Port is working as Layer 2):

 

interface GigabitEthernet1/0/24
Description "Connected_to_SW_Gig0/0" Switchport mode trunk switchport trunk native vlan  10

 

If your Router will not support to above commands then you have to change the router configuration from VLAN based to Subinterfaces of the router. Let me if you need any other help on the same.

 

Regards,

Deepak Kumar 

 

 

 

  

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

This seems doesn't work, when I cancel one default route (

no ip route 0.0.0.0 0.0.0.0 192.168.20.1

) it will going to work. but I just wan Vlan 10's computer should go via vlan 10 (192.168.10.1) and Vlan 20's via vlan 20 (192.168.20.1). If does like up changes all will re-route to one gateway.

I am a bit puzzled about the router configuration given which has interfaces vlan 10 and vlan 20. How do you get vlan interfaces on a router? I would have expected something like sub interfaces on a router physical interface if the switch was connected to the router using a trunk.

 

You provide an interesting explanation of what you want to accomplish:" I just wan Vlan 10's computer should go via vlan 10 (192.168.10.1) and Vlan 20's via vlan 20 (192.168.20.1)" There are 2 good alternatives on how to accomplish this

1) you could keep routing enabled on the switch and enable Policy Based Routing and configure it so that traffic from vlan 10 on the switch is forwarded using the router interface for vlan 10 and that traffic from vlan 20 on the switch is forwarded using the router interface for vlan 20. (assuming that your switch has support for PBR)

2) you could simply disable routing on the switch and make sure that vlan 10 on the switch is connected to the vlan 10 interface of the router and that vlan 20 on the switch is connected to the vlan 20 interface on the router. This would be much more simple and easy than the PBR alternative and so this is the one that I would recommend.

 

HTH

 

Rick

HTH

Rick

Hi Richard Burts;
"sub interfaces on a router physical interface" you mean like router on a stick cisco?
1) the switch doesn't support PBR,
2) if disable routing, I need setup desktop's default gateway: 192.168.10.1 which was in the route's vlan, and the bandwidth between vlan10 and vlan20 will only be maximum36Mbps, although interface was gigabit. That's why I want to setup to the switch.

Yes when I talked about sub interfaces on a physical interface that is router on a stick. Perhaps you can tell us more about how the switch connects to the router? Is it a switch trunk port to a router interface? Is it a switch access port to a router interface (for each vlan)? What kind of router is this? How does the router have interfaces vlan 10 and vlan 20?

 

If the switch does not support PBR then this is not an option.

 

It seems to me that you have mutually exclusive requirements. You have a requirement to do routing on the switch. You also have a requirement that traffic from devices in vlan 10 should go through the vlan 10 interface on the router and devices in vlan 20 should go through the vlan 20 interface on the router. Basically this is saying that you want to forward traffic based on the source address. PBR could accomplish that but is not an option on this switch. I can not think of a way that you can do routing on the switch and also be sure that traffic from vlan 10 will go through vlan 10 interface of router.

 

HTH

 

Rick

HTH

Rick

Hi Rick;

Yes, the router interface was trunk and it’s cisco 1921, before I setup vlan 10/20 in the router and it’s connect to D-Link unmanaged switch, because of the vlan’s bandwidth issue, so I add another cisco 2960s switch.

I just want to be separated, like if I setup “IP route 0.0.0.0 0.0.0.0 192.168.10.1” on the switch, and the vlan 20’s computer outbound internet access will also go through 192.168.10.1 gateway.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card