Gateway question

Unanswered Question
Jan 16th, 2008

I am connecting to gig port 1/0/23

which is on vlan 212

The IP address for that vlan is 172.20.212.4 255.255.255.0

The IP i'm assigning the host is 172.20.212.101 255.255.255.0

The default gateway configured on the switch itself is 172.20.210.1

I configured the host with the same default gateway as the switch

However I am unable to ping the host from the switch

I can however ping the vlan interface (212.4) but no other vlan interfaces

or even the default gateway from the host

I do show packets input/out on the gig port..and no errors...port is set for auto

The host IP (.101)is showing up in the ARP table of the switch

Should my default gateway be something else??

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Richard Burts Wed, 01/16/2008 - 11:55

Richard

Yes it should be different. The default gateway of the PC should point at the IP address of the VLAN interface of the switch for that VLAN. So if the VLAN interface is 172.20.212.4 then that should be the default gateway configured on the PC.

HTH

Rick

nygenxny123 Wed, 01/16/2008 - 13:44

my office pc is set for vlan 1.

The ip address for the pc 192.168.1.41

the vlan ip is 192.168.1.191

no other vlans are configured.

however, i am getting a default gateway that is the same default gateway configured in the switch.

191.168.1.252

seems odd?

shouldnt i be getting the vlan int. as a gateway?

Richard Burts Wed, 01/16/2008 - 21:02

Richard

I believe that this is very closely related to another other question that you posted in the forum and to which I have given an answer. So let me make a couple of quick points and refer to that answer for other details.

You do not indicate in this post whether the switch your PC is connected to is a layer 2 or a layer 3 switch, but based on the context (and on a comment in your other question) I would assume that the switch to which your PC connects is a layer 2 switch. If the switch is a layer 2 switch then the default gateway of the PC can not point to the switch interface address as its default gateway.

The default gateway of a PC must be an address on a layer 3 device (capable of IP forwarding), and must satisfy 2 conditions:

- it must be in the subnet of the host (determined by the address and subnet mask of the host)

- it must be in the VLAN (broadcast domain) of the host.

So I am assuming that the PC in your office is connected to a layer 2 switch and its default gateway is a router interface address (which is also the default gateway of the layer 2 switch).

HTH

Rick

nygenxny123 Thu, 01/17/2008 - 06:03

Yes, My pc is connected to a cat. 2950, which I assume only has layer 2 capabilities?

However, the site with vlan ip interfaces configured is a 3750. Which I assume has layer 3 capapbilites? But it does not have

routing enabled. From my understanding

you would have to enable routing on a L3 switch to have intervlan routing. Only

a default gateway is conf. See below

3750switch##sh ip route

Default gateway is 172.20.210.1

Host Gateway Last Use Total Uses Interface

ICMP redirect cache is empty

nygenxny123 Thu, 01/17/2008 - 10:03

here is my config for the 3750 switch-

it doesnt look like routing is enabled-

so what should the servers that are connected have as the default gateway if routing isnt enabled on the switch?

here is the coplete config-it is stacked-i edited some gig interface info for space-notice gig 2/0/52

!

hostname xxxxxxxxxxx

!

enable xxxxxxxx

!

no aaa new-model

switch 1 provision ws-c3750g-48ts

switch 2 provision ws-c3750g-48ts

vtp domain xxxxxxxx

vtp mode transparent

ip subnet-zero

!

!

!

!

!no file verify auto

!

spanning-tree mode rapid-pvst

spanning-tree extend system-id

spanning-tree vlan 210-211 priority 8192

!

vlan internal allocation policy ascending

!

vlan 210

name xxxxxxxx

!

vlan 211

name xxxxxxxxxx

!

vlan 212

name xxxxxxxxxx

interface GigabitEthernet2/0/52

description to fw core

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 210-212

switchport mode trunk

!

interface Vlan1

ip address 172.20.110.4 255.255.255.0

shutdown

!

interface Vlan210

ip address 172.20.210.4 255.255.255.0

!

interface Vlan212

ip address 172.20.212.4 255.255.255.0

!

ip default-gateway 172.20.210.1

ip classless

ip http server

ip http secure-server

!

Richard Burts Thu, 01/17/2008 - 15:19

Richard

From the fact that it appears to have 2 layer 3 interfaces configured with IP addresses (or 3 interfaces if you count the one that is shutdown) I would assume that IP routing is enabled.

As far as what the servers should have configured as their default gateway I believe that servers in VLAN 210 have a choice. They could use 172.20.210.4 which is the switch interface and should work. Or I believe that they could also use 172.20.210.1 which is in the same subnet and I would presume in the same VLAN.

For servers in VLAN 212 I would believe that they should use 172.20.212.4.

HTH

Rick

nygenxny123 Thu, 01/17/2008 - 15:51

Hi Rick

I tried 212.4 gateway and a 212.1 gateway for a server in the 212 vlan.

Only when the server was configured with the 212.1 gateway was I able to ping the device

from remote router. As i see no ip routing

command on the 3750. Can I assume that

this is only performing a l2 function?

and if so-is the vlan ip needed since it looks to be router on a stick?

Richard Burts Thu, 01/17/2008 - 18:34

Richard

To help figure out this situation would you post the output of show ip route from the switch?

HTH

Rick

nygenxny123 Thu, 01/17/2008 - 19:10

Hi Rick-

Hi Rick-

here is the ouput

3750switch##sh ip route

Default gateway is 172.20.210.1

Host Gateway Last Use Total Uses Interface

ICMP redirect cache is empty

Richard Burts Thu, 01/17/2008 - 20:17

Richard

Thanks for posting the additional information. It does indicate that routing is not enabled (based particularly on the fact that there are no connected interfaces in the routing table). If routing is not enabled then the server default gateway needs to be the router interface that is connected in its VLAN.

HTH

Rick

nygenxny123 Fri, 01/18/2008 - 03:53

than you rick-

you have helped me alot.

so basiclly the vlan ip's on this switch

are not needed except for perhaps logging in?

Richard Burts Fri, 01/18/2008 - 14:24

Richard

Yes for this situation the VLAN IPs are for logging in or other management purposes. They do not play any part in forwarding user traffic.

HTH

Rick

Actions

This Discussion