configuring a switch with 2 hosts

BennyTheManBennyTheMan Member Posts: 76 ■■■□□□□□□□
I now know how to set up a router with two hosts and ping but am unsure how to do the same with a switch instead of a router. I am unable to get the switch config to work, however. I am unable to assign IP addresses to the interfaces on the switch. If I am completely wrong on this issue, please don't humiliate me unless it is constructive. I am just getting started with this stuff and am studying alone. Any ideas?

Thanks in advance,

-Benny

Comments

  • clarsonclarson Member Posts: 903 ■■■■□□□□□□
    you don't assign ip addresses to the the switch's interfaces. switches work at layer 2. They don't care about ip addresses. all they care about are mac address. The mac address of the frames that enter a switch port. So, if the switch is in it's default mode, just connect your hosts and router to the switch and it should work. of course, your using cross over cables to connect the hosts to the router. To connect the hosts and router to a switch, you will need straight through cables.
  • BennyTheManBennyTheMan Member Posts: 76 ■■■□□□□□□□
    I got the cabling right but can't ping. I'll keep trying different stuff now that I know I don't need to assign IPs to the interfaces. Thanks
  • clarsonclarson Member Posts: 903 ■■■■□□□□□□
    do you have console access to the switch?

    if you do assign an ip address to it's SVI (switch vitual interface).
    conf t
    interface vlan 1
    ip address theAdress subnetMask
    no shut
    end

    the ip address has to be on the same subnet as the hosts and router.

    then you can ping the SVI ip address from the hosts. can you ping from the switch to the hosts.

    are the lights on the interface showing green?
    are you getting mac addresses in the mac address table
    on the switch: show mac address-table dynamic
    show ip interface brief
    is the status and protocol show up and up for the ports with cables connected?
  • DCDDCD Member Posts: 475 ■■■■□□□□□□
    Are the host in the same subnet? If not you need to setup Vlan and intervlan routing. It best to show your work instead of say it doesn't work.
  • GDainesGDaines Member Posts: 273 ■■■□□□□□□□
    If you're using physical hosts (PCs) and the only lab equipment is the 2 hosts plugged in to a switch, then I'm assuming you've used static IP addresses on the hosts? Otherwise you'll need a layer3 switch with DHCP set up on it, or you'll need a router set up for Router On A Stick (ROAS - Google it, you'll need to learn it if you've not already).

    In scenario 1 (switch + 2 hosts only) give VLAN1 on the switch an IP address. It doesn't matter what class you use, so let's just pick 10.0.0.1. Clarson showed you how, or just ask if you're not sure. Now give your hosts addresses. Set host1 to 10.0.0.10 and host2 to 10.0.0.11. Give everything a subnet mask of 255.255.0.0 and set the default gateway on the 2 hosts to the VLAN1 address of 10.0.0.1. You can leave the DNS servers blank.

    1. Now from host1 ping yourself to make sure networking is working: 10.0.0.10
    2. Next, ping the default gateway: 10.0.0.1
    3. And if they both worked try pinging host2: 10.0.0.11

    If the first step failed check network drivers. If the second step failed check cables, and use show ip int brief on the switch console to make sure VLAN1 shows as Up/Up (Administratively Down most likely means you forgot to use no shutdown). If the final step fails, but steps 1 and 2 work on both hosts then turn off any firewalls as it's probably that blocking the responses.
Sign In or Register to comment.