Adding a port in VLAN 2 and asigning an IP

Unanswered Question
Oct 4th, 2007
User Badges:

I have a 3550 48 port switch. When ever I try to add an IP on to a port which is not a member fo any VLAN the switch gives me an error that the IP is part of VLAN 2 and when I try to add that port on Vlan2 it says


Switch1(config)#interface fastethernet 0/35


Switch1(config-if)#switchport access vlan 2

Command rejected: Fa0/35 not a switching port.

Do specify me how to configure the port in Vlan 2

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
ankbhasi Thu, 10/04/2007 - 05:32
User Badges:
  • Cisco Employee,

Hi Imran,


Issue a command "switchport" and then try your command and it should work.


HTH


Ankur


*Pls rate all helpfull post

Jon Marshall Thu, 10/04/2007 - 05:32
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Hi


if you want to add the port into vlan 2


switch1(config-if)# switchport

switch1(config-if)# switchport access vlan 2


HTH


Jon

imranraheel Thu, 10/04/2007 - 06:06
User Badges:

After doing


Switch1(config)#interface fastethernet 0/35

Switch1(config-if)#switchport

Switch1(config-if)#switchport access vlan 2


Switch1(config-if)#end


I am not been able to assign IP to this port since it now becomes a L2 Port.


Is there a way to add it in to Vlan2 and assign the port IP as with different ports which are in Vlan2 having perticular IP's


Kevin Dorrell Thu, 10/04/2007 - 05:33
User Badges:
  • Green, 3000 points or more

Perhaps you could give us the complete show run int F0/35. Also a show int F0/35 switchport


If it is not a switching port (i.e. it is layer-3) and you want it to become so, do switchport


If it is a layer-3 port, then you should be able give it an IP address.


Or maybe the problem is that the address you are trying to give it overlaps with a range of addresses you have put on the vlan 2 routed interface. Perhaps you could tell us show run int vlan 2, and what address you are trying to put on the port.


The other possibility is that it is involved in a SPAN session. Do show monitor to verify that is not so.


Kevin Dorrell

Luxembourg


imranraheel Thu, 10/04/2007 - 06:05
User Badges:

After doing


Switch1(config)#interface fastethernet 0/35

Switch1(config-if)#switchport

Switch1(config-if)#switchport access vlan 2


Switch1(config-if)#end


I am not been able to assign IP to this port since it now becomes a L2 Port.


Is there a way to add it in to Vlan2 and assign the port IP as with different ports which are in Vlan2 having perticular IP's


Jon Marshall Thu, 10/04/2007 - 06:09
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

If you make it a routed ported ie "no switchport" then you cannot allocate an IP address to it out of a subnet you have already used on the switch.


So, as Kevin says, if you have allocated vlan 2 layer 3 interface an ip address you cannot then allocate another ip address from the same subnet to this routed port.


What is it you are trying to achieve ?


Jon


imranraheel Thu, 10/04/2007 - 06:34
User Badges:

Basically I have connected that interface to a router and I want to assign an IP to interface where that router is connected so I can make few routers like to router data intended towards that destination connected to that router.


What is the best possible way


Either I should remove the port from VLAN 2 and assign an IP but that IP is from the same series of Vlan 2 so it gives an error that


207.XXX.XXX.XX overlaps with Vlan2 address


Do let me know the best possible way

Kevin Dorrell Thu, 10/04/2007 - 06:38
User Badges:
  • Green, 3000 points or more

The external router has an interface, with an IP address, right? And the hosts are also in the subnet of that IP address?


If that is the case, you don't need the layer-3 functions of the switch at all, and you don't need to configure any IP addresses on it. Just leave each port as a switchport and put them all in VLAN 2, including the one where the router is connected. As far as layer-3 is concerned, the external router will be talking directly to the hosts.


Kevin Dorrell

Luxembourg.


Jon Marshall Thu, 10/04/2007 - 06:43
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

If you want the router interface to have an IP address from vlan 2 subnet allocate the port on the switch into vlan 2.


If you want the router interface to not have an IP address out of vlan 2 then allocate a small P2 subnet eg. 192.168.1.0/30 and


router fa0/0 192.168.1.1 255.255.255.252

switchport 192.168.1.2 255.255.255.252


The switch will need to be running ip routing for the second option to work.


HTH


Jon

Kevin Dorrell Thu, 10/04/2007 - 06:31
User Badges:
  • Green, 3000 points or more

There are only two architectures you can go for.


1. Have your ports in VLAN 2, in which case they are layer-2 ports. They share one IP address. (Actually, you can give them more, but then they share all of them.) In this case, you put the IP address on int vlan 2, and also any secondary addresses, but they are all shared. Forwarding between members of the VLAN are by MAC address.


2. Have your ports in layer-3 no switchport. In that case you can assign a subnet to each port, and port to port communication is via the routing element of the switch. In that case, the IP ranges may not overlap, otherwise router element does not know which one to route to. Forwarding is by IP address.


I suspect there is a more basic misunderstanding though. What are you trying to achieve?


Kevin Dorrell

Luxembourg

imranraheel Thu, 10/04/2007 - 06:51
User Badges:

Switch1#show run int vlan 2

Building configuration...


Current configuration : 214 bytes

!

interface Vlan2

description MIXIT Client VLAN

ip address 207.xxx.xxx.xxx 255.255.255.192

no ip redirects

ip pim sparse-dense-mode

standby 1 ip 207.xxx.xxx.xxx

standby 1 priority 105

standby 1 preempt

end


-------------------------------------------


Switch1#show int F0/35 switchport

Name: Fa0/35

Switchport: Enabled

Administrative Mode: dynamic desirable

Operational Mode: down

Administrative Trunking Encapsulation: negotiate

Negotiation of Trunking: On

Access Mode VLAN: 2 (ClientVLAN)

Trunking Native Mode VLAN: 1 (default)

Administrative Native VLAN tagging: enabled

Voice VLAN: none

Administrative private-vlan host-association: none

Administrative private-vlan mapping: none

Administrative private-vlan trunk native VLAN: none

Administrative private-vlan trunk Native VLAN tagging: enabled

Administrative private-vlan trunk encapsulation: dot1q

Administrative private-vlan trunk normal VLANs: none

Administrative private-vlan trunk private VLANs: none

Operational private-vlan: none

Trunking VLANs Enabled: ALL

Pruning VLANs Enabled: 2-1001

Capture Mode Disabled

Capture VLANs Allowed: ALL


Protected: false

Unknown unicast blocked: disabled

Unknown multicast blocked: disabled

Appliance trust: none

------------------------------------------


Above are the results you mentioned before.


Basically I want to use that Port to connect to a router So that if some request is intended towards that router IP i will add a route to pass that request from the switch port to router


# ip "router IP" "switch port IP"

Kevin Dorrell Thu, 10/04/2007 - 07:00
User Badges:
  • Green, 3000 points or more

No need for any IP addresses anywhere on the switch then. Just put the port where the router connects in switchport access vlan 2, and all the host machine ports as well.


Kevin Dorrell

Luxembourg


imranraheel Thu, 10/04/2007 - 07:09
User Badges:

You mean i should put the IP on router insted of switch. The same Vlan2 IP so I can place that route

Kevin Dorrell Thu, 10/04/2007 - 07:16
User Badges:
  • Green, 3000 points or more

It's a bit difficult to see what is going on with all those X.x.x. in the IP addresses. Could you tell us the addresses - alter them to disguise them if you want, but keep the relationship between them.


What address range do your hosts have. What address is on the external router?


For example, if you external router is 172.16.22.1 255.255.255.192, then your hosts can be anything from 172.16.22.2 to 172.16.22.62. Forget about the VLAN 2 interface on the switch - just blow it away. Put all the ports in VLAN 2 as switchports, and the hosts will talk to your external router.


Kevin Dorrell

Luxembourg


imranraheel Thu, 10/04/2007 - 07:22
User Badges:

Kevin;


I almost got the point i need to assign IP to the router interface whihc is directly connected to port 35 on the switch and that IP should be from VLAN2 subnet so VLAN 2 will be able ti use it and than I can place routes in switch to route perticular requset from that router

Kevin Dorrell Thu, 10/04/2007 - 07:33
User Badges:
  • Green, 3000 points or more

If I have understood your architecture, I don't think you need any layer-3 VLAN 2 interface on the switch at all. no int vlan 2. You will still have the layer-2 switch VLAN 2.


Just put all the switchports on VLAN 2 switchport access vlan 2, and put an IP address on your router and on each host, and it should work.


There is no need for any IP addresses or routes on the switch at all.


Kevin Dorrell

Luxembourg


intelide3 Thu, 10/04/2007 - 10:21
User Badges:

hi,


correct, you can add an ip address on interface vlan command (to route the traffic) - but you canT assign an ip address on a switchport.


so - you have to create int vlanx (the vlan which you want to route the traffic) - assign it an ip address, and give the vlan a switchport for remote router (not your local 3500 L3 switch).


and, you will need an active (cable-plugged) vlan switchport to ping the interface vlan ip.


dont forget no shut command.


HTH.


Dedy.


syed_khalid_khu... Thu, 10/04/2007 - 20:51
User Badges:

Switch1(config)#interface fastethernet 0/35


Switch1(config-if)#no switchport

Switch1(config-if)#ip address

Switch1(config-if)#no shut


Actions

This Discussion