Can I put two different network in a single switch?

uuuugeshforuuuuugeshforu Registered Users Posts: 2 ■□□□□□□□□□
Hi guy,
Need you again
So I have a switch with have 4 pc's connected to it. 2 pc's have IP 192.168.1.0 range and two have 192.168.2.0
Both are different network.
So can pc's of first network communicate with pc's of other network?

I tried in Packet tracer they are not pinging. I am doing right?

Comments

  • verbhertzverbhertz Member Posts: 54 ■■□□□□□□□□
    Look up intervlan routing. They need a gateway to route between the two subnets.
  • NansNans Member Posts: 160
    Use a layer 3 switch 3560 in the packet tracer and use the following commands in the global config mode

    ip routing
    int vlan number
    ip address 192.168.1.1 255.255.255.0
    int vlan num
    ip address 192.168.2.1 255.255.255.0

    thats it they can reach each other. There is one more way we can do it its Router on a Stick which means you can use a router to create route between these vlan's . You can refer to inter-VLAN routing to get further more idea.

    Hope this helps

    Regards
    2016 Certification Goals: CCNP Route /COLOR][B][/B][I][B]X[/B][/I][COLOR=#008000-->Switch/COLOR]:study:[COLOR=#ff8c00-->TShoot[], CCDP []
  • docricedocrice Member Posts: 1,706 ■■■■■■■■■■
    When a host in the 192.168.1.0/24 net wants to talk with one in the 192.168.2.0/24 net, it first has to check how large the network the one it's sitting in is. In this case, it can tell (based on its configured subnet mask of 255.255.255.0) that the other host is in a different network (because its own network is limited in range from 192.168.1.1 - .254), it then has to send it to a routing gateway because that other host is "outside of its zone" so to speak.

    Then the TCP/IP stack of the first host has to 1) determine that MAC address of the routing gateway by sending an ARP request (assuming there's a default gateway configured in its TCP/IP settings) and then 2) generate a frame with the proper headers and put it onto the wire where the switch will receive it and process it to whichever physical port has that target MAC in its CAM table (unless the switch is doing layer 3 work, in which case it just forwards it to the 192.168.2.0/24 network unless things like ACLs, etc. get in the way).

    It's hard to grasp this until you realize that each host has TCP/IP software which considers its field-of-view and narrows it based on that subnet mask. Just because the hosts are on the same physical switch (even if they're on the same VLAN/same broadcast domain) doesn't mean they can just "broadcast" the traffic back and forth without considering the size of their respective home networks.

    The only time the two hosts in this case can see each other's traffic is if 1) they happen to be in the same VLAN and 2) they're sending out broadcasts where the frame has a destination MAC of FF:FF:FF:FF:FF:FF, which means the switch will just forward it to all ports in that VLAN. ARP and some DHCP messages will fall into this category.
    Hopefully-useful stuff I've written: http://kimiushida.com/bitsandpieces/articles/
  • SimridSimrid Member Posts: 327
    As above. You will need a layer 3 switch and you give the interface of the switch and IP address in the relevant networks along with assigning it with the correct subnet.

    If you have any questions, drop me a PM.
    Network Engineer | London, UK | Currently working on: CCIE Routing & Switching

    sriddle.co.uk
    uk.linkedin.com/in/simonriddle
  • ImYourOnlyDJImYourOnlyDJ Member Posts: 180
    Nans wrote: »
    Use a layer 3 switch 3560 in the packet tracer and use the following commands in the global config mode

    ip routing
    int vlan number
    ip address 192.168.1.1 255.255.255.0
    int vlan num
    ip address 192.168.2.1 255.255.255.0

    thats it they can reach each other. There is one more way we can do it its Router on a Stick which means you can use a router to create route between these vlan's . You can refer to inter-VLAN routing to get further more idea.

    Hope this helps

    Regards

    My first thoughts would be to try as Nans suggested especially the IP Routing command (commonly forgotten). Also make sure you have the correct default gateways on the PCs
Sign In or Register to comment.