Ip address for switches
Ravenclaw
Member Posts: 43 ■■□□□□□□□□
in CCNA & CCENT
Hey all, I am studying for the ccna and am trying to get all the commands in the packet tracer down. I am trying to give a switch
an IP address. It seems pretty straight forward but I am getting the same error. hoping you guys can help. Plus I had a couple questions too. Thanks in advance.
GigabitEthernet0/1 unassigned YES unset up up
GigabitEthernet0/2 unassigned YES unset up up
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int vlan1
Switch(config-if)#int gig 0/2
Switch(config-if)#ip address 1.1.1.254 255.255.255.0
^
% Invalid input detected at '^' marker.
Questions:
The exercise has four switches and 5 nodes can they all be on Vlan 1? I figured that it would not matter due to mac addresses
Should the switch ip address be in the high or low range of addresses?
an IP address. It seems pretty straight forward but I am getting the same error. hoping you guys can help. Plus I had a couple questions too. Thanks in advance.
GigabitEthernet0/1 unassigned YES unset up up
GigabitEthernet0/2 unassigned YES unset up up
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int vlan1
Switch(config-if)#int gig 0/2
Switch(config-if)#ip address 1.1.1.254 255.255.255.0
^
% Invalid input detected at '^' marker.
Questions:
The exercise has four switches and 5 nodes can they all be on Vlan 1? I figured that it would not matter due to mac addresses
Should the switch ip address be in the high or low range of addresses?
Comments
-
gbdavidx Member Posts: 840Im still learning ccent, but i dont think you need the int- gig 0/2, what is this?
from jeremy, on his switch he had the following:
switch(config)#int vlan 1
switch(config)#ip 11.1.254 255.255.255.0 and then do your defualt gateway command, you dont need the int gig 0/2
i would think you would make it at the low end, so 1.1.1.0, but im a newb -
Ravenclaw Member Posts: 43 ■■□□□□□□□□Hmm...ok
I thought you had to go into the interface which was a gigabit 0/2 port to put the IP address in?
If I have 4 switches and no router do I still need a default gateway?
Thanks for the input, hopefully someone can iron this out soon, its holding me up pretty bad.... -
theodoxa Member Posts: 1,340 ■■■■□□□□□□When you add "int Gig 0/2", you are switching from VLAN 1 to a specific port (Gigabit 0/2). The IP Address goes on a VLAN interface, unless it was a Layer 3 Switch (3550/3560) and you were making the port a routed instead of switched port.R&S: CCENT → CCNA → CCNP → CCIE [ ]
Security: CCNA [ ]
Virtualization: VCA-DCV [ ] -
theodoxa Member Posts: 1,340 ■■■■□□□□□□Hmm...ok
I thought you had to go into the interface which was a gigabit 0/2 port to put the IP address in?
If I have 4 switches and no router do I still need a default gateway?
Thanks for the input, hopefully someone can iron this out soon, its holding me up pretty bad....
If there is no router, then there is no default gateway. The default gateway just tells the switch where to send packets originating from the switch and destined for a different subnet.R&S: CCENT → CCNA → CCNP → CCIE [ ]
Security: CCNA [ ]
Virtualization: VCA-DCV [ ] -
miltiades49 Registered Users Posts: 1 ■□□□□□□□□□Routers are layer 3 devices and every interface of a router belongs to a different subnet. i.e. each interface has a different IP and subnet mask combination. Using these assigned IP addresses, routers make routing decisions. Switches are layer 2 devices (not refering to layer 3 switces) and therefore must belong to a subnet. To define to which subnet a switch belongs to one must define the correct IP address to a Vlan on the switch. Interfaces on switches do not have IP addresses but rather they just belong to vlans (subnets).
To sum this up...
1) switches belong to subnets. Just give an IP address to a switch's vlan to achieve that.
2) Router interfaces define subnets. Just give a different IP and mask combination to each interface to achieve that.
Please forgive me if my explanation is somewhat confusing but my english are not very good. -
Futura Member Posts: 191To assign a L3 address to a switchport you need to enter 'No switchport' command to make it a L3 port in the first place.
Or just create an SVI and assign your ports to the VLAN associated with the SVI. -
Ravenclaw Member Posts: 43 ■■□□□□□□□□Thanks for all the help, my problem was I was I was putting an IP address on the Switch interface and not the Vlan, finally got it to work..