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

ip routing not working for default gateway

RobCannon3691
Level 1
Level 1

Hello,

Noob here trying to setup a 4948 switch.

 

I am having a hard time establishing a connection to my default gateway from a vlan. I am following this guide on intervlan routing where I setup a vlan per the layout below and am able to ping the commodity router router successfully from the switch and I am able to ping the switch from my host. I am just not able to a ping the router from the host on vlan 2.

 

Below are some of the config outputs.

 

Switch#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
....

Gateway of last resort is 10.75.245.180 to network 0.0.0.0

10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Vlan2
C 10.75.245.0 is directly connected, GigabitEthernet1/1
S* 0.0.0.0/0 [1/0] via 10.75.245.180
Switch#show running-config
Building configuration...

Current configuration : 2580 bytes
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Switch
!
boot-start-marker
boot-end-marker
!
!
!
!
no aaa new-model
ip subnet-zero
!
!
ip vrf mgmtVrf
!
!
!
!
power redundancy-mode redundant
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
!
interface FastEthernet1
ip vrf forwarding mgmtVrf
no ip address
speed auto
duplex auto
!
interface GigabitEthernet1/1
no switchport
ip address 10.75.245.131 255.255.255.0
!
interface GigabitEthernet1/2
switchport access vlan 2
switchport mode access
!
interface GigabitEthernet1/3

...

interface TenGigabitEthernet1/50
shutdown
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 10.1.2.1 255.255.255.0
!
interface Vlan101
ip address 10.75.245.132 255.255.255.0
shutdown
!
ip default-gateway 10.75.245.180
ip route 0.0.0.0 0.0.0.0 10.75.245.180
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
stopbits 1
line vty 0 4
!
end


What I did to set it up was very simple and I followed this guide as I mentioned. What I don't see in the running-config is the "ip routing" enabled which would explain why it is not routing to the default gateway but I entered the command and tried setting "ip default-gateway 10.75.245.180" to point to my router but nothing. I have my nic set properly to 10.1.2.2 with default gateway to 10.1.2.1 pointing to the vlan. I know this is simple but is driving me insane. Just trying to setup a local DHCP and DNS server with a few private subnets and ip-helper to point to my DHCP on vlan 2.

 

Thank you very much for any help.

1 Accepted Solution

Accepted Solutions

Sorry, I am talking about the routing on the router, not the switch. The router needs to know how to get back to the PC, so it should have a route like:

 

10.1.2.0/24 via 10.75.245.132

 

or 

 

10.0.0.0/8 via 10.75.245.132

 

Hope this helps,

 

Dave

View solution in original post

8 Replies 8

Hello,

 

ip routing is enabled by default, so you won't see it in the running config. I think the below is your problem:

 

interface Vlan101
ip address 10.75.245.132 255.255.255.0
shutdown

 

Unshut (no shut) the interface...

 

Switch#conf t

Switch(config)#int vlan 101

Switch(config-if)#no shut

Thank you for the help.  

 

That vlan was an artifact of me trying to work this out.  In the config from before I directly assigned an IP to the interface.  To activate it based on your feedback, I received an overlapping IP error when I ran "no shut" on vlan 101.  So to I removed the IP from the interface before following your suggestion per the commands below.

 

 

Switch(config)# int Gi1/1 
Switch(config-if)# switchport 
Switch(config-if)# switchport access vlan 101
Switch(config-if)# switchport mode access 
Switch(config-if)# no shutdown
Switch(config-if)# exit 
Switch(config)# int vlan 101 
Switch(config-if)# no shutdown 
Switch(config-if)# exit 

 

I still am not able to ping the router from the host connected to vlan 2 but am able to ping the host and router from the switch.  What is strange is that the router is not seeing the ip address of switch when I set the Gi1/1 port to switchport where before the router showed the ip of the port when I configured it statically. 

 

What would you try next?  Thanks again. 

Deepak Kumar
VIP Alumni
VIP Alumni

Hi,

What is model number of your switch? As you mentioned that you could n't find "IP routing" command in running configuration than I recommended to remove "IP default-gateway"command and apply with IP routing and enable CEF. I hope you issue will resolved. If not then share the version and model number of Switch.

 

Regards,

Deepak Kumar

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

Thank you for the suggestion.  

 

My switch is a Catalyst 4948 running cat4500-IPBASEK9-M software. 

 

I ran "no ip default-gateway 10.75.245.180" to remove that and I ran "show ip cef" which gave me prefix:0.0.0.0 next hop: 10.75.245.180 (router) interface: vlan 101 which seems to be correct. CEF is enabled on the Gi1/1 interface. 

 

Is there anything else I can post from the config?

 

Thank you very much for the help. 

dbeattie
Level 1
Level 1

Assuming that your PC has its default gateway set to 10.1.2.1, the problem might be that your router does not have a route to 10.1.2.0/24. Can you please check this? The other way to test this would be to ping from your PC to 10.75.245.131, which should be reachable and will verify that the switch is routing properly.

 

Hope this helps.

 

Dave

Thank you for the help. 

 

I think you meant being able to ping the switch from the computer on 10.75.245.132 (not 131) which it can successfully and yes the default gateway is 10.1.2.1. 

 

As far as the route, it shows 

Switch#show ip route 
Codes: ....

Gateway of last resort is 10.75.245.180 to network 0.0.0.0 

10.0.0.0/24 is subnetted, 2 subnets 
C      10.1.2.0 is directly connected, Vlan2 
C       10.75.245.0 is directly connected, Vlan101 
S*      0.0.0.0/0 [1/0] via 10.75.245.180 

This all looks good to me.  Anything that I am missing?  Thank you for the help. 

Sorry, I am talking about the routing on the router, not the switch. The router needs to know how to get back to the PC, so it should have a route like:

 

10.1.2.0/24 via 10.75.245.132

 

or 

 

10.0.0.0/8 via 10.75.245.132

 

Hope this helps,

 

Dave

Thank you so much.  Yeah, that was the issue.  I gave a static route on my router to the 10.1.2.0/24 range with the gateway of the ip address I set for the vlan that is connected to the router.  I didn't know my router needed to have that range open.  

 

I can now reach interwebz, worldwide. 

 

Now I will bang my head till I get the DHCP working with the ip helper-address pointing to the host I set up with the scopes enabled (so far no good). 

 

Thank you!