• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3577
  • Last Modified:

2 subnets - 1 router - HP 2620 Switch routing


I didn't think this would be too difficult, but it seems it is for me!

I have 1 draytek router - 2830n -
I have purchased a HP 2620-24 PoE+ Lite Layer 3 switch -
I have 1 subnet on 192.168.0/24
I have 1 subnet on

I've put the switch on the subnet. All endpoints on that subnet can access the net ok.

Now, i would like to connect a server from the 1/24 subnet to the switch & have it access the internet via the router (

I've enabled IP Routing on the switch, but cannot ping the router from the server. I can ping the switch address ok though.

How do i best accomplish this?
  • 3
  • 2
2 Solutions
There are a few ways you can solve this.

It sounds like what you are trying to implement here is routing on a stick.  
You want one router to use 802.1q trunking to be able to route 2 different subnets.  
The router port would have one link into the switch that will have 2 sub interfaces, 1 for each vlan.

The switch port it is plugged into will be an 802.1q trunking port.
There will need to be 2 VLANs configured on the switch, one for each subnet.
The hosts in will be plugged into access ports configured in VLAN 1, where the hosts in will be plugged into access ports configured in VLAN 2.
See attached scenario 1 Scenario 1- Router on a stick
If indeed you are trying to use the L3 switch as your router instead, make sure your hosts on the network can ping their gateway of the virtual interface configured on your switch (  

If they can, then you should see if they can ping their next hop,  If this ping does not work then you may need to put a default route on the L3 switch pointing all traffic towards the next hop Scenario 2- Layer 3 Switch
I hope this helps conceptually.
cuadminAuthor Commented:

Thanks for the very descriptive information.

I had the 'router on a stick' scenario working previously, however i would prefer to use the L3 switch if i could. I'm trying to get my head around options & configurations in my lab first, before i will implement a similar setup in my office shortly.

There's a need to put a 2nd subnet in the 1/24 range on a separate VLan to the 0/24 hosts however the 2 will need to be able to talk to each other.

From the server address of i can ping the switch interface address of, but i cannot ping the router address of

If i need a default route on the switch, how do i accomplish that?
I believe if you create a second interface on the router for the 2nd vlan, you may be able to get the 2 vlans talking to each other.  For instance, needs to be created and if I remember correctly, bound, to vlan 2.

The host on vlan 2 ( will have to configure the newly created gateway on the switch as its gateway.  Try pinging the new gateway from your vlan 2 host after these steps are completed.

Let me know if this gets you further.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

If you want the switch to do the inter-vlan-routing then you will need
1) asigned IP to vlans on switch
2) clients pointing to IP of vlan on switch
3) ip-routing on switch
4) routing between switch and router BOTH ways

1) you have
vlan 1
IP address
now add
vlan 2
IP address

2a) clients in vlan 1:
IP 192.168.0.x  netmask default gateway
2b) clients in vlan 2:
IP 192.168.1.x  netmask default gateway


4a) on switch set default gateway:
4b) on router add a route back to vlan2 via vlan1-IP of switch, something like:

cuadminAuthor Commented:
Thanks for this. I'm on another job at present & won't be able to try this out for a few days. I'll keep you posted but it sounds exactly like what i need to do.
cuadminAuthor Commented:
Thankyou for your time & information. Really apppreciate it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now