cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4641
Views
0
Helpful
7
Replies

Assign a specified IP address to device based on port in switch

jason.c
Level 1
Level 1

I?m looking for a way to assign a specified IP address to IP printers based on what port on a switch they are plugged into. Will any switches accomplish this?

Right now we are using serial printers with Avocent ESP-8 serial hubs. These hubs have not been reliable and are difficult to program and troubleshoot.

7 Replies 7

JORGE RODRIGUEZ
Level 10
Level 10

Hi Jason,

When you assign IP address to the printers and connect them to a switchport simply assing the proper vlan# membership on the switcport, where vlan# is the referece of the subnet IP the printer will be under.

HTH

Jorge

Jorge Rodriguez

Thank you for the reply.

I do not want to specify the IP address on the printer. It will need to use DHCP or something else to get its IP address. It needs to receive an IP address based on what port it is plugged into on the switch. That way, when a printer is moved to a different location, it will receive the IP address that the printer in that location should have. Are there any switches that can be configured to do this? Thanks

Maybe the 802.1x login can fit in this case. Check this link:

http://www.cisco.com/en/US/docs/switches/lan/catalyst2960/software/release/12.2_25_fx/configuration/guide/sw8021x.html#wp1062632

The Catalyst 2960 is a good choice. You just need to use a RADIUS server to authenticate the supplicant device.

I hope it helps.

thank you for the reply.

Looking into that, I'm unsure how an 802.1x login will assign a specific IP address to a device based on the port in the switch that it is plugged into. Is there something I'm missing?

An example of what I'm am looking for:

I would like for any IP printer that is plugged into port 2 on the switch to be automatically assigned the IP address 192.168.1.2 and any IP printer that is plugged into port 3 to be automatically assigned the IP address 192.168.1.3. That way if an IP printer that is plugged into port 2 (with an IP address of 192.168.1.2) is moved to port 3 it?s IP address will automatically change to 192.168.1.3.

The switchport information is not supplied during a DHCP negotiation, therefore you will need to perform IP management a bit different.

DHCP provides the ability to create reservations under scopes. With reservations, you enter the MAC address of the printing device and assign a static IP address for that device.

If you have the ability to change the MAC address of the printing device, then you can achieve what you are after.

The only way I can think of doing this is by using small VLANs - how important is printing? ie do you need full HSRP or will you be able to handle a short outage of printing if there is a router issue?

I'll go with managing without if there is a problem

interface vlan 23

des printer 1

ip add 10.1.99.1 255.255.255.252

interface vlan 24

des printer 2

ip add 10.1.99.5 255.255.255.252

int fas 0/15

des printer 1

switch mode acce

switch acce vlan 23

int fas 0/16

des printer 2

switch mode acce

switch acce vlan 24

dhcp pool printer-1

network 10.1.99.0 /30

default-g 10.1.99.1

dhcp pool printer-2

network 10.1.99.4 /30

default-g 10.1.99.5

Please note there may be the odd typo in there as I hve done this from memory, but it should be close enough to get you going. If you need more info by DHCP, you would really need to use a separate DHCP server and use helper addresses instead.

Please also note that this assumes it is all being done on one L3 switch - you may need to split this across multiple devices if you are using an L2 switch as the access switch for the printer - the routing and DHCP pools would be on the L3 device.

This way basically you only have one address available in each VLAN, and the VLAN is used on only one port, so that address can only be given to the one port.

The difference for HSRP is that you would need a bigger VLAN to accommodate two real addresses and the standby address. I would recommend going with just the non-HSRP option if you can as tha uses half the addressing per printer. It is not very economical though, as you are using a block of four per printer.

Paul.

Please remember to rate useful posts.

Review Cisco Networking products for a $25 gift card