cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
23329
Views
15
Helpful
7
Replies

Assigning Static IP to LAN Ports - Catalyst 2960-S Switch

saviopereira1
Level 1
Level 1

Hello all Techs,

       Just wanted some quick advice in configuring  a Cisco Catalyst 2960-S Switch, If anyone can please advise me How to configure the following;

I want to assign the a range of IP addresses (For e.g. 10 IP addresses, for argument sake 181.6.226.35 - 181.6.226.45)  to the ports 1-10 on the switch. Each of this ports should be accessible only through the assigned IP address. A specific Device will be connected to these ports once configured. For eg. SIP Server

Assume that, If i have to connect a laptop to one of this ports than i'll have to set the static ip address on the device to access the port and get on to the network.

Hope this makes sense. 

Thanks,

Sav

1 Accepted Solution

Accepted Solutions

Mark Malone
VIP Alumni
VIP Alumni

Hi

2960 is layer 2 only you cant assign an ip directly to the ports , you can have a vlan with a ip/subnet and then all the ports assigned to that vlan and then give the devices an ip in that range so they can communicate with the vlan and be part of that subnet broadcast domain

interface vlan 1

ip address 10.1.1.1 255.255.255.0

!

interface range g0/1 - 10

switchport access vlan 10

...................................

Then give pc ip like 10.1.1.2/24 ith gateway of 10.1.1.1

View solution in original post

7 Replies 7

Mark Malone
VIP Alumni
VIP Alumni

Hi

2960 is layer 2 only you cant assign an ip directly to the ports , you can have a vlan with a ip/subnet and then all the ports assigned to that vlan and then give the devices an ip in that range so they can communicate with the vlan and be part of that subnet broadcast domain

interface vlan 1

ip address 10.1.1.1 255.255.255.0

!

interface range g0/1 - 10

switchport access vlan 10

...................................

Then give pc ip like 10.1.1.2/24 ith gateway of 10.1.1.1

saviopereira1
Level 1
Level 1

Hi Mark,

          Thanks for your recent reply, If possible can you please assist me to set this up. For illustration I've got this example below; All the IPs below are public IPs. This must be a piece of cake for you :)

Network Address
186.5.219.32

Usable IP's

186.5.219.33 - 186.5.219.45

Gateway

186.5.219.46

Broadcast Address

186.5.219.47

I want to set the Usable IPs to the Ports 1-12 using the VLAN as you have stated. 

Appreciate all your help.

Thanks,

Sav

I don't really get your setup or what exactly your trying to do , you would not usually use public ips on a switch like that or give access port devices public ips they would be private like 10 range or 172 or 192 address space

The public ip would go on the router and then you would use network address translation between the private and public ip so it can be reached from the internet or vice versa

do you have a design or topology your trying to follow setup here ?

Hi Mark,

          I Have attached a Network design for your reference. This is something i'm trying to setup in a small office. The IP addresses have been allocated by an ISP but the ones i have provided are only for an illustrative purpose. Is this kind of setup really possible. I want to be able to access the addresses externally.

Appreciate your help bud.

Thanks,

Sav

Hi ok my opinion on that is its a waste of public ip addresses , you only need to use 1 at the router on the wan interface on the 2811 all other addresses can be private so you conserve the public ips as they cost money and can be used elsewhere

Then what you would do is give everything else a private address in the 10 range behind it

10.1.1.2 - 10.1.1.15 for your devices /24 laptops,servers,DB etc

Then on the 2811 router use NAT overload with static NAT , these 2 docs are very easy to understand and show exactly how to set it up

Nat overload basically maps all your private ips to the public ip ,static NAT allows pcs say out of the network coming in to be able to reach your webservers or mail servers from the internet even though they have a private address

example of how to set overload

http://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/260-cisco-router-nat-overload.html

The you may also need static nat for the ports your servers would be using if they require https access , maybe smtp 25 for mail etc

Example of how to set this -----http://www.techrepublic.com/blog/data-center/configure-static-nat-for-inbound-connections/ 

..............................................................

For the connection between the router and the 2960 you could use a sub-interface router on stick setup with the 2960 set as a trunk

See this shows you how to set this r.n.stick setup

http://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/336-cisco-router-8021q-router-stick.html

so....

1 Create router and stick setup between 2811 and 2960

2 Give all your devices ip in private range part of the subnet range used

3 make sure you can ping the router gateway interface (LAN side port) from the devices

4 Create the NAT overload as per DOC

5 Create the NAT static for the services required for the servers as per DOC

6 Test the NAT connection's you built by trying to access the servers

WAN port on router would be 10.1.1.1 255.255.255.0 so all devices gateway would be that

You could use all your public ips if you want but everything will be internet facing then and its a waste when you can use private ips

Drug_Store
Level 1
Level 1

Sorry wrong topic. Pls delete my comment.

ajit1015
Level 1
Level 1

2960 is L2 switch so you can't assign ip address directly to port

Review Cisco Networking for a $25 gift card