Setting up a VLAN part 2



  • @stephenw10:

    Ok, reading the relevant manual for that switch:
    http://ftp.hp.com/pub/networking/software/2810-AdvTrafficMgmt-July2007-59914733.pdf

    For static VLANs, which we are using here, No is equivalent to Exclude.
    You would only use 'forbid' when using Dymanic VLANs (see GVRP). This is way beyond my experience is something that you're very unlikely to need.  ;)

    Steve

    yeah, i agree, i was going to stick with no.



  • @stephenw10:

    The three different port modes are like this as I understand it, though I don't actually have an HP switch:

    E - Exclude this port from VLANX. I.e. any packets arriving on the port from outside tagged VLANX will be disgarded and any packets inside the switch tagged VLANX will not switched to this port.

    U - Untagged port. I.e. packets in the switch tagged VLANX can be switched to this port and will have tags removed when leaving. Untagged packets arriving on this port will be tagged VLANX upon entering the switch.

    T - Tagged port. Packets tagged VLANX inside the switch can be switched to this port and leave the switch still tagged. Packets arriving at the switch tagged VLANX are allowed to enter.
    Confusingly this this port type is also referred to as a trunk port because it can be a member of many vlans carrying all traffic to your router.

    In the switch configuration packets arriving at ports 2, 3 or 4 will be tagged VLAN100 as they enter the switch. They can then be switched to any other port participating in VLAN100 (1-4). If the packet is addressed to the internet somewhere it will be switched to port 1 where it leaves the switch still tagged and arrives at re1 where the pfSense VLAN100 interface is setup to receive it and route it appropriately.

    Returning packets are sent to the switch from pfSense tagged VLAN100. Port 1 allows them to enter the switch and they are switched to the correct port. On leaving the port (2-4) the VLAN tagging removed so that the pakets arrive back at the client untagged and able to received.

    Steve

    ok, if i am understanding this correct, will my next vlan look like this?

    vlan1- E E E E E E U U (re2) ports 7,8 operate on 192.168.1.x

    vlan 100- T U U U E E E E (re1) ports 1,2,3,4 operate on 10.10.10.x

    vlan 200- T E E E U U E E (re1) ports 5,6 operate on 172.10.10.x (new VLAN i will create)

    my only question (assuming i did it right) is…am i right in tagging port 1 in vlan100 and vlan200 since it shares the same cable/nic to pfsense?


  • Netgate Administrator

    Yes looks good.  :)
    In this setup you will have only one port available for 192.168.1.X clients since the other is linked back to re2. This means you can still access the switch GUI on that subnet though.

    Steve



  • @stephenw10:

    Yes looks good.  :)
    In this setup you will have only one port available for 192.168.1.X clients since the other is linked back to re2. This means you can still access the switch GUI on that subnet though.

    Steve

    ok good, i think i am picking up on vlans.

    actually, that one port plugs into a 16 port netgear switch, so anything on that switch is also 192 and will also be able to hit pfsense since it is on the 192.168.1.x subnet.

    EDIT- so for every additional vlan i create, port 1 will always be tagged, assuming the vlan connects back to the same NIC in pfsense?  i only bring it up because the other hp switch i have access to has 24 ports, so i can create more vlans and assign them to re1.  and if i did that, port 1 in every vlan would always be tagged, right?…..that is what i gathered after reading this:

    T - Tagged port. Packets tagged VLANX inside the switch can be switched to this port and leave the switch still tagged. Packets arriving at the switch tagged VLANX are allowed to enter.
    Confusingly this this port type is also referred to as a trunk port because it can be a member of many vlans carrying all traffic to your router.


  • Netgate Administrator

    @tomdlgns:

    ok good, i think i am picking up on vlans.

    Yep.  ;)

    @tomdlgns:

    actually, that one port plugs into a 16 port netgear switch, so anything on that switch is also 192 and will also be able to hit pfsense since it is on the 192.168.1.x subnet.

    Not a problem then.

    @tomdlgns:

    EDIT- so for every additional vlan i create, port 1 will always be tagged, assuming the vlan connects back to the same NIC in pfsense?  i only bring it up because the other hp switch i have access to has 24 ports, so i can create more vlans and assign them to re1.  and if i did that, port 1 in every vlan would always be tagged, right?

    Yes you always need to add the pfSense connection as a tagged port in order to allow VLAN tagged packets to make it back pfSense where it can be received by the VLAN interface.

    Assuming port1 is connected to re1, and that re1 has VLAN interfaces setup on it (as it is currently) then yes you would add this as tagged to every VLAN. (except VLAN1!)

    Once you have a good grip on this you can try something interesting like connecting your second switch to the first one. Then it's possible to send VLANs between the switches using tagged ports on the connecting cable. But one step at a time!  ;)

    Steve



  • @stephenw10:

    @tomdlgns:

    ok good, i think i am picking up on vlans.

    Yep.  ;)

    @tomdlgns:

    actually, that one port plugs into a 16 port netgear switch, so anything on that switch is also 192 and will also be able to hit pfsense since it is on the 192.168.1.x subnet.

    Not a problem then.

    @tomdlgns:

    EDIT- so for every additional vlan i create, port 1 will always be tagged, assuming the vlan connects back to the same NIC in pfsense?  i only bring it up because the other hp switch i have access to has 24 ports, so i can create more vlans and assign them to re1.  and if i did that, port 1 in every vlan would always be tagged, right?

    Yes you always need to add the pfSense connection as a tagged port in order to allow VLAN tagged packets to make it back pfSense where it can be received by the VLAN interface.

    Assuming port1 is connected to re1, and that re1 has VLAN interfaces setup on it (as it is currently) then yes you would add this as tagged to every VLAN. (except VLAN1!)

    Once you have a good grip on this you can try something interesting like connecting your second switch to the first one. Then it's possible to send VLANs between the switches using tagged ports on the connecting cable. But one step at a time!  ;)

    Steve

    Assuming port1 is connected to re1, and that re1 has VLAN interfaces setup on it (as it is currently) then yes you would add this as tagged to every VLAN. (except VLAN1!)

    correct, vlan1 is untouched from what i have above.

    Once you have a good grip on this you can try something interesting like connecting your second switch to the first one. Then it's possible to send VLANs between the switches using tagged ports on the connecting cable. But one step at a time!  ;)

    this is exactly the next thing i was going to try once i got vlan200 setup.  i wont even ask my question until i can successfully get vlan200 up and online.

    thanks for the help.



  • so you finally had it?



  • @Metu69salemi:

    so you finally had it?

    i finally got it, yes.

    Edit- or are you asking if i have had enough of vlans?  ???



  • no no, i just ask that you got it working. Congrats, hopefully i could help you even a bit



  • ok, just added a 24 port vlan switch and added a 3rd vlan…vlan 200 172.10.10.x

    now that i figured out the tagging/untagging, it was pretty easy to configure the switch.

    i must say, documentation is key with vlans.  i logged into the switch and used the port name and wrote in the vlan it belongs to, but i also have it written down on paper.

    this is what my switch config looks like (this switch doesnt use E for exclude, it uses N, which has been posted already).

    vlan1- U U U U U U U U N N N N N N- 192.168.1.x
    vlan100- N N N N N N N N T U U U N N- 10.10.10.x
    vlan200- N N N N N N N N T N N N U U- 172.10.10.x

    i was able to hit the internet with a PC using a dhcp address from the 172 range and i stopped at 14 ports.

    now that i got the hang of this, linking another VLAN switch should be easy.  i just need to make sure that i tag the ports on the other switch to work with the respective vlans...1, 100, 200



  • That's true until you hit unmanaged switch, then you can use only one vlan on that port of managed switch and that should be untagged



  • @Metu69salemi:

    That's true until you hit unmanaged switch, then you can use only one vlan on that port of managed switch and that should be untagged

    right, if i want to do multiple vlans on other switches they need to be vlan switches.  i follow what you are saying.

    right now one of the untagged ports for vlan1 is plugged into a 16 port netgear switch, that switch can only operate on 1 subnet since it isnt vlan capable, in this case 192.168.1.x.



  • finished adding some block rules to stop traffic between vlans. disabled it one way to test, enabled it again, did some more testing, the rules did exactly what they were suppose to do.

    dns question- i can ping other IPs, but i cant browse by going to \pc-name

    any idea what i need to do to get that working?

    i can access \ip-address w/o any issues, which is why i assume DNS.

    the dhcp server settings for LAN is what i used as a template for vlan100 and 200 and my LAN DNS lookups work fine.



  • where you do have dns setup?

    @tomdlgns:

    right now one of the untagged ports for vlan1 is plugged into a 16 port netgear switch, that switch can only operate on 1 subnet since it isnt vlan capable, in this case 192.168.1.x.

    You can also use another vlan if you require


  • Netgate Administrator

    I assume you are using DNS forwarding on pfSense for your DNS service. That's the default.
    You can have pfSense add any client that sends it's host name to the local DNS table.
    Go to Services: DNS Forwarder: and check 'Register DHCP leases in DNS forwarder'.

    This will only kick in when clients renew their DHCP lease so you may have to force that to test.

    Steve



  • @Metu69salemi:

    where you do have dns setup?

    it is the default setup.  the only thing i did was point to OpenDNS servers for lookups (and removed the first entry of 127.0.0.1).



  • @stephenw10:

    I assume you are using DNS forwarding on pfSense for your DNS service. That's the default.
    You can have pfSense add any client that sends it's host name to the local DNS table.
    Go to Services: DNS Forwarder: and check 'Register DHCP leases in DNS forwarder'.

    This will only kick in when clients renew their DHCP lease so you may have to force that to test.

    Steve

    ok, just did this, i will delete DHCP leases and remote reboot machines and see if that fixes it.

    EDIT- now that i think of it…the device i was trying to access by hostname was statically assigned, this option looks like it is only DHCP related.  that device will never ask for a new address since it is static.


  • Netgate Administrator

    You can add static dhcp IPs with an option on that same page. Or if you have statically assigned the IP on the client itself you can add it manually in the host overrides table at the bottom.

    If I need to have anything static I always use static DHCP rather then IPs coded at the client. It makes this sort of thing far easier. Also if I do have to change the IP ever it's all centrally stored.

    Steve



  • @stephenw10:

    You can add static dhcp IPs with an option on that same page. Or if you have statically assigned the IP on the client itself you can add it manually in the host overrides table at the bottom.

    If I need to have anything static I always use static DHCP rather then IPs coded at the client. It makes this sort of thing far easier. Also if I do have to change the IP ever it's all centrally stored.

    Steve

    makes sense and i am going to look into that, thank you.

    ok, i did that, i added the entry for the static device.

    when i ping it, it resolves to a public internet address not the internal IP…..hmmmm


  • Netgate Administrator

    You may have to clear the local dns cache. Make sure your client is using the DNS forwarder.
    You can try using the Diagnostics: DNS Lookup: tool to check pfSense can resolve it correctly.

    Steve



  • @stephenw10:

    You may have to clear the local dns cache. Make sure your client is using the DNS forwarder.
    You can try using the Diagnostics: DNS Lookup: tool to check pfSense can resolve it correctly.

    Steve

    DNS lookup in pfsense can see the correct name if i type in the ip and it shows the correct ip if i type in the name.

    but it uses 127.0.0.1, then 208.67.222.222, 208.67.220.220, finally 192.168.1.1

    i do want my machines to use openDNS server for external lookups, but obviously not for internal lookups, which is what i think it happening, but i could be wrong.

    local cache cleared and my ipconfig looks like this

    ip- 172.10.10.210
    sub- /24
    gate- 172.10.10.1

    dns- 172.10.10.1


  • Netgate Administrator

    127.0.0.1 is the local machine, which it is checking first. That seems correct. I don't know why it's looking at 192.168.1.1 though, that sounds wrong.
    See my screenshots.

    Steve






  • i know 127 is localhost, but i removed that from the DNS page.

    my DNS forwarders are 208.67.222.222, 208.67.220.220, and 192.168.1.1 (for devices that sometimes grab 3 DNS IPs.

    although, 192.168.1.1 might be wrong and i probably shouldn't keep it in there now that i no longer have a flat network.


  • Netgate Administrator

    @tomdlgns:

    my DNS forwarders are 208.67.222.222, 208.67.220.220, and 192.168.1.1 (for devices that sometimes grab 3 DNS IPs.

    You mean in System: General Setup: DNS Servers: ?

    That should only list external DNS servers that pfSense uses for DNS resolution.

    Steve



  • @stephenw10:

    @tomdlgns:

    my DNS forwarders are 208.67.222.222, 208.67.220.220, and 192.168.1.1 (for devices that sometimes grab 3 DNS IPs.

    You mean in System: General Setup: DNS Servers: ?

    That should only list external DNS servers that pfSense uses for DNS resolution.

    Steve

    ok, no problem, i will remove the 192 entry, if i do that, then only the openDNS servers remain, but those are in spot 1,2 right now so i dont think it will fix my issue, but i will still remove it.

    thanks.


  • Netgate Administrator

    Ok. Well yes it has to first use the local DNS table so 127.0.0.1 should show first as in my screenshot.
    Where exactly did you remove 127.0.0.1 from?

    pfSense will always use the local DNS table first unless you have checked 'Do not use the DNS Forwarder as a DNS server for the firewall' in System: General Setup: DNS Servers:

    Steve



  • @stephenw10:

    Ok. Well yes it has to first use the local DNS table so 127.0.0.1 should show first as in my screenshot.
    Where exactly did you remove 127.0.0.1 from?

    pfSense will always use the local DNS table first unless you have checked 'Do not use the DNS Forwarder as a DNS server for the firewall' in System: General Setup: DNS Servers:

    Steve

    i didnt remove it, i thought i saw an option to uncheck the use of it.


  • Netgate Administrator

    Hmm, that looks fine. Exactly as I have mine set.

    Yet when you use Diagnostics: DNS Lookup: it doesn't use 127.0.0.1?

    Steve



  • ok, i just added 127.0.0.1 as the first entry and bumped down the openDNS servers.



  • @stephenw10:

    Hmm, that looks fine. Exactly as I have mine set.

    Yet when you use Diagnostics: DNS Lookup: it doesn't use 127.0.0.1?

    Steve

    yeah, i think i am going to take it out, if yours doesnt have 127.0.0.1 listed as the first one.



  • this is what my settings are as of this post:

    C:>ping ds2411

    Pinging ds2411.home [192.168.1.254] with 32 bytes of data:
    Reply from 192.168.1.254: bytes=32 time<1ms TTL=64
    Reply from 192.168.1.254: bytes=32 time<1ms TTL=64
    Reply from 192.168.1.254: bytes=32 time<1ms TTL=64
    Reply from 192.168.1.254: bytes=32 time<1ms TTL=64

    Ping statistics for 192.168.1.254:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 0ms, Average = 0ms

    C:>



  • i think it is a mac thing.  i was trying to ping from my MBP and it was coming back with ds2411 as a public IP address 67.25.xxx.xxx i only x it out because i am not by my MBP and i dont remember the rest of the address.

    good news- the option you told me to check a few posts backs when you brought up DHCP worked for windows computers, i tested two computers that were resolving ds2411 to 67.25…..and they now resolve to the correct internal 192.168.1.254 address.

    bad news- not working for my mbp.  i tried clearing the cache and releasing/renewing ip...nothing, maybe a reboot?  i havent had the mbp for a long time, not an expert with it/settings on it.


  • Netgate Administrator

    Hmm, well I have almost no mac experience so I'm probably no help.
    I would guess that it's using an external dns server some reason. Seems odd though.

    What external address is it resolving to? Your WAN address?

    Steve



  • @stephenw10:

    Hmm, well I have almost no mac experience so I'm probably no help.
    I would guess that it's using an external dns server some reason. Seems odd though.

    What external address is it resolving to? Your WAN address?

    Steve

    no, i have no clue, let me see if putting it in google tells me anything.

    edit- it looks like that IP address belongs to/is an address that openDNS uses/works with for failed lookups.

    it makes sense since i open up a cmd prompt and typed in ping afffaasdf

    it came back with the same 67.215 IP address that i get when i type ping ds2411 from the mac.

    no worries, this isnt related to pfsense or vlans or DNS since all my other machines are working w/o issues.



  • ok, now lets talk about getting two vlan switches to talk.

    right now this is what both switches look like.

    8 port-

    1- E E E U U U U U
    100- T U E E E E E E
    200- T E U E E E E E

    24 port-

    1- U U U U U U U U E E E E E E U U U U U U U U U U
    100- E E E E E E E E T U U U E E E E E E E E E E E E
    200- E E E E E E E E T E E E U U E E E E E E E E E E

    i know i have to link the respective vlan ports to each vlan switch, but do the packets stay labeled as i have them above? or do i need to switch a few things around when linking from switch to switch?


  • Netgate Administrator

    When you link from switch to switch you can send all the VLANs along a trunk connection, the same as you do to pfSense.
    So you have one cable connected between the switches. The port that that cable is connected to is set as 'tagged' in each VLAN you want to send along it at both ends.

    I'm not sure how you have your 24-port switch connected so I can't give you an exact switch config.

    Steve



  • @stephenw10:

    When you link from switch to switch you can send all the VLANs along a trunk connection, the same as you do to pfSense.
    So you have one cable connected between the switches. The port that that cable is connected to is set as 'tagged' in each VLAN you want to send along it at both ends.

    I'm not sure how you have your 24-port switch connected so I can't give you an exact switch config.

    Steve

    the 24 port switch is connected to the 8 port switch as follows:

    port 4 on HP-switch8 goes to port 8 on HP-switch24.

    however, i dont think the proper tags are in place.

    EDIT-
    both tags are marked as U and it looks like they both need to be changed to T, correct?



  • ok, marked port 4 in the 8 port switch from U to T

    and marked port 8 in the 24 port switch from U to T

    everything seems to be operating as it should.



  • Like i tried to say several times, if no vlan support on switch/client use untagged.
    If vlan support exists then use tagging


  • Netgate Administrator

    In your diagram above port 4 on Switch8 and port 8 on Switch24 are marked E for both VLANs.
    Did you change them to U subsequently?
    They should be T as you said.

    Steve


Log in to reply