cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
85118
Views
5
Helpful
4
Replies

Basic question on default gateway & VLAN

news2010a
Level 3
Level 3

                   Hello, imagine I want to make VLAN200 workstations communicate like the show in the attachment.

What would be the default gateway to be configured in the workstation?

If I configure 192.168.1.1 as the default gateway (R1 interface fa0/0) is this right?

That could be possible because the switch should be configured with command "ip default-gateway 192.168.1.1"?

4 Replies 4

Arumugam Muthaiah
Cisco Employee
Cisco Employee

Hi,

Yes, you can configure the 192.168.1.1 (R1 int fa0/0) as default gateway for host which is connected on SW1 2950.

On SW1 2950, you need to set the default gateway,

#interface vlan vlan-id

Enter interface configuration mode, and enter the VLAN to which the IP information is assigned. The range is 1 to 4094 when the enhanced software image is installed and 1 to 1001 when the standard software image is installed. Do not enter leading zeros.

#ip address ip-address subnet-mask

Enter the IP address and subnet mask


ip default-gateway ip-address

Enter the IP address of the next-hop router interface that is directly connected to the switch where a default gateway is being configured. The default gateway receives IP packets with unresolved destination IP addresses from the switch.

Once the default gateway is configured, the switch has connectivity to the remote networks with which a host needs to communicate.

Note When your switch is configured to route with IP, it does not need to have a default gateway set.

Regards,

Aru

*** Please rate if the post is useful ***

Regards, Aru *** Please rate if the post useful ***

Ok, but is really necessary configure the Switched Virtual Interface (#int vlan id) on the switch in order to make the default-gateway command work in the switch?

Hi,

your 2 PCs are in same subnet so they don't need a default gateway to communicate but they will do an ARP request for each other MAC and it will be dropped by the router as it doesn't forward packets destined to 255.255.255.255.

If you do a static arp entry on each host pointing to the router MAC of connected interface, you've solved first problem.

Now the router can receive the unicast packet from PC1 and it must route the packet so you must configure a static host route pointing out the fastethernet interface linked to other PC.You do the same for other host IP for return traffic.

When the router forwards the packet it must rewrite the L2 header and so you need to configure a static arp entry for each host.

Regards.

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

nkarthikeyan
Level 7
Level 7

Hi ,

I hope your design needs to be altered. When you have a L2 switch with fa0/1 configured for VLAN 200 and if you connect your router with different IP address segment and if you set a default gateway in 192.168.x.x it will not go through. How if you interface is in a vlan of diff segment will comuunicate to a directly connected interface of a router with different IP segment. All you can do is.... You can cascade both the 2950 switches together by connecting each of it with the same VLAN and uplink towards router can be configured from one 2950 switch and pointing the gateway IP address from the same segment. let say your switches  vlan ip address is 172.16.0.2/16 for switch A and 172.16.0.3/16 for switch B and you can have the router configured for 172.16.0.1/16. So if you make default gateway as router it will go through.

By

Karthik

Review Cisco Networking for a $25 gift card