1

I have set up a VLAN on my Procurve switch, with ports 12 and 13. The Internet comes in on port 2. My issue is that I can't give the VLAN an Internet connection and have the rest of the switch have Internet, too.

Why can't I add the port that gives the switch Internet to multiple VLANs? Can anyone help?

I just want all my VLANs to get an Internet connection, or do I need a router per VLAN?

3
  • Please consider posting the switch configuration and a diagram of what you're intending. It sounds as if you need a router but we can't be sure.
    – Zac67
    Sep 24, 2017 at 17:22
  • 1
    Each VLAN is a distinct layer 2 segment or broadcast domain. VLANs cannot communicate with each other without a router.
    – Zac67
    Sep 24, 2017 at 17:29
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Feb 19, 2018 at 19:22

3 Answers 3

1

That is a layer-2 switch. When using VLANs, you need a layer-3 device (router) to get traffic from one VLAN to another VLAN.

Hosts can send frames directly on a VLAN from one host to another host, but for a host to send traffic to a different network, the host must send the traffic to its configured gateway (router). The gateway must be on the same LAN as the host (otherwise, the host would need a gateway to send to its gateway, creating a chicken/egg problem).

Switches switch traffic on the same LAN, but routers route traffic between LANs.

0

If your internet access can have vlan or two ip address you don't need a router, just tag each interface in your differents vlan, but if your internet access only have 1 IP you definitely need a router. You can not add a port on two vlan without tagging.

3
  • 1
    With any Internet access for more than one computer you require a router.
    – Zac67
    Sep 24, 2017 at 19:36
  • Well, it is not very clear what kind of device is the internet access based upon, but as it is plugged into the switch I guess it a kind of adsl modem/router, it is not clear that the OP be aware of the possibility to use vlan tag on it.
    – dominix
    Sep 24, 2017 at 19:47
  • Such a consumer-grade device, although technically a router, is off-topic here.
    – Ron Maupin
    Sep 24, 2017 at 19:51
0

Your HP 2810-24g does have basic Layer 3 capabilities, known as Layer 3 Lite, and it could be used as a router.

All you have to do is update your new VLAN config, by assigning an IP address to the VLAN interface (known as SVI in Cisco parlance):

myswitch(config)# vlan 20
myswitch(vlan-if)# ip address 1.2.3.1 255.255.255.0

When two or more VLANs have an IP address, your switch is a router in pectore.
In order to enable routing in CLI, give this command in global config context:

myswitch(config)# ip routing
myswitch(config)# ip default-gateway A.B.C.D

Where A.B.C.D is you firewall IP address.

Remember to add a static route to the firewall for new LAN segments that are reachable through the switch/router, and please do remember to apply source NAT to packets leaving the firewall directed to Internet.

2
  • Sorry, the 2810-24G has no routing ability - just verified with the manual.
    – Zac67
    Sep 25, 2017 at 16:41
  • Well, your firewall has to do the routing stuff. You have to configure one switchport as a trunk, to allow the VLANs you need. Connect this port to a firewall interface where you have defined as many VLAN interfaces, as you have on the switch side. Each firewall's VLAN interface IP address will be the VLAN default gateway. Just remember to source NAT packets going to the Internet. Sep 26, 2017 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.