9 Replies Latest reply on Apr 21, 2017 3:34 AM by mick

    Switch Port Addressing

    shdawson New Member

      Hi,

      Can a NetVanta 3120 switch port be assigned an IP address?

        • Re: Switch Port Addressing
          jayh Hall_of_Fame

          shdawson wrote:

          Can a NetVanta 3120 switch port be assigned an IP address?

          Indirectly. It can be configured as an access port on an otherwise unused VLAN. Then a VLAN virtual interface can be created and assigned an IP address.

           

          From a practical standpoint, it's equivalent to assigning an IP address to the port.

          • Re: Switch Port Addressing
            martinluth123 New Member

            When a VLAN interface on an AOS device attempts to get an IP address via DHCP, it can’t simply pull an IP address from a DHCP host pool, at least not if the host pool is only trying to identify the AOS device via MAC address.  In order to accurately assign a static/dynamic IP, you need to use a client-identifier to match the VLAN instead.  For example:

            ip dhcp pool "1238"

                 default router 192.168.50.2

                 host 192.168.50.11 255.255.255.0

                 client-identifier 00:00:a0:c8:3f:24:b3:00:0a

            That DHCP pool will provide an address to an AOS device’s VLAN 10 interface with MAC address 00:a0:c8:3f:24:b3.  The simplest way to determine the client-identifier being used by a dhcp-client is to get a packet capture and check the DHCP Discover message.   If you expand the Discover packet and check the Option 61, Client Identifier section you can see the appropriate value being presented.  If a packet capture isn’t feasible, it’s fairly simple to determine the client-identifier when the DHCP client is an AOS device’s VLAN interface.  In each case, the identifier is the MAC address with a prepended "00:" and then four hex characters that follow the VLAN’s MAC.  The hex characters correlate to the VLAN requesting an address (VLAN “000a” = VLAN 10). see for dissertation writing services

              • Re: Switch Port Addressing
                shdawson New Member

                Thanks, much appreciated.

                 

                -SHD

                • Re: Switch Port Addressing
                  mick New Member

                  Hi martinluth123, can you please explain use cases where it would be useful for a VLAN on 3120 to be configured as an interface with a dhcp pool host IP address, rather than as a network subnet?  For example:

                  !

                  ip dhcp pool "VLAN 5"

                       network 10.10.21.0 255.255.255.0

                       dns-server 10.10.19.254

                       default-router 10.10.19.254

                       ntp-server 10.10.19.254

                  !

                   

                  Any devices connected to the switchport(s) assigned to VLAN 5 will obtain an IP address within the 10.10.21.0/24 subnet and use the gateway on IP 10.10.19.254, because the IP for the VLAN 5 interface would have been defined like so:

                  !

                  Interface vlan 5

                       description VLAN 5

                       ip address 10.10.21.1 255.255.255.0

                       ip access-policy Private

                       no shutdown

                  !

                  --

                  Regards,

                  Mick

                    • Re: Switch Port Addressing
                      jayh Hall_of_Fame

                      mick wrote:

                       

                      Hi martinluth123, can you please explain use cases where it would be useful for a VLAN on 3120 to be configured as an interface with a dhcp pool host IP address, rather than as a network subnet? For example:

                      !

                      ip dhcp pool "VLAN 5"

                      network 10.10.21.0 255.255.255.0

                      dns-server 10.10.19.254

                      default-router 10.10.19.254

                      ntp-server 10.10.19.254

                      !

                       

                      Any devices connected to the switchport(s) assigned to VLAN 5 will obtain an IP address within the 10.10.21.0/24 subnet and use the gateway on IP 10.10.19.254, because the IP for the VLAN 5 interface would have been defined like so:

                      !

                      Interface vlan 5

                           description VLAN 5

                           ip address 10.10.21.1 255.255.255.0

                           ip access-policy Private

                           no shutdown

                      !

                       

                      This would be a misconfiguration as the gateway would not be within the subnet. Default-router should be 10.10.21.1 which is the VLAN interface.

                        • Re: Switch Port Addressing
                          mick New Member

                          Thanks jayh, I was just giving an example where the router/gateway is on a different subnet to the VLAN.  The gateway does not *have* to be withing the same subnet, although I agree it is neater.  I have tried such a (mis)configuration and it works, although it adds an additional route in the LAN clients' route tables.

                          --

                          Regards,

                          Mick

                        • Re: Switch Port Addressing
                          jayh Hall_of_Fame

                          mick wrote:

                           

                          Hi martinluth123, can you please explain use cases where it would be useful for a VLAN on 3120 to be configured as an interface with a dhcp pool host IP address, rather than as a network subnet?

                           

                          I personally can't think of any valid reason to configure a VLAN interface with a host IP address. Configuring it that way would make it impractical for anything to connect to it. If you want to define a single host IP reachable on a 3120 you would be better using a loopback.

                           

                          For a DHCP pool, it is possible to configure a host IP address if your goal is to assign a specific IP based on the hardware MAC address of the client. For your example above this would assign the address 10.10.21.100 to the client device with MAC address DE:AD:BE:EF:F0:0D :

                          !

                          ip dhcp pool "TASTYSTEAK"

                          hardware-address DE:AD:BE:EF:F0:0D ethernet

                          host 10.10.21.100 255.255.255.0

                          dns-server 10.10.19.254

                          default-router 10.10.21.1

                          ntp-server 10.10.19.254

                          !

                           

                          This is sometimes done with devices such as printers where you don't want to manually configure a static IP on the device but also don't want it to change.

                           

                          Martinluth123 was giving an example where a DHCP server on another device could be used to assign a specific IP address to a VLAN interface on an AOS device acting as a DHCP client. He is stating that you can't just use the MAC hardware address for a VLAN interface acting as a DHCP client but need to use a client-identifier. While this is indeed possible and his example would work, short of a very devious exam question in a lab environment or BOFH-ish job security I can't think of a practical use for this.

                           

                          In other words, if you want to have a VLAN interface assigned a specific IP address by means of a DHCP server elsewhere, follow his example. Or skip the external DHCP server, static mapping, client identifier, etc. and just type the IP and subnet into the VLAN interface config directly. Because when someone replaces the unit two years down the road they'll go nuts trying to figure out why that VLAN interface no longer gets an IP address.

                            • Re: Switch Port Addressing
                              mick New Member

                              Thank you jayh for a detailed answer.  I hadn't thought of your example with a printer!  I guess at the back of my mind I always envisaged a switch being connected at the router's switchport on a VLAN.