How to Ping From PC1 to PC2 with Different IP Address - networking

My problem is unable to PING from PC2 to PC1, but the PC1 can PING to the PC2.
PC1: 192.168.0.35
PC2: 192.168.5.30
Do I need setting in the Mikrotik or somewhere else?
Please open the picture
Network Sample

the problem could be something related to firewall on the mikrotik device as far as it allows the packet flow in one direction but not for the oposite

PC1 and PC2 are not on the same network.
You have to configure the routes.

Related

How a PC can ping two diferent PCs with the same ip address in different vlans?

I have a question about VLANs and how they work.
here is the scenario;
I have a VLAN named vlan10 with PC1 and PC2 in it
The IP address of PC1: 10.10.10.10
The IP address of PC2: 10.10.10.20
and a VLAN named VLAN 20 with pc3 and pc4 in it
The IP address of PC3: 10.10.10.10
The IP address of PC4: 10.10.10.20
and they are connected to a switch and a router like this
Can PC1 ping IP address 10.10.10.20 in VLAN 20 which is IP address for PC4 in VLAN 20?
or because we have the same IP address in VLAN 10, PC1 can not ping the PC4 in VLAN 20?
Each PC matches an outgoing packet's destination address to its own subnet and talks to the destination directly. Even if you tried working around that using the router, the router would reject duplicate subnet addresses across different interfaces.
Whether duplicate addresses actually exist in the VLANs is irrelevant. When the destination address belongs to the sender's local subnet that's the end of the story.
Btw: you should take care to note the subnet prefix lengths, I'm assuming you use 10.10.10.0/24 (doesn't change the answer though).

Ping can't go across router connecting 2 LANs [Packet Tracer]

Topology of the network
The subnetworks work fine within themselves and pings reach their destinations but pings can't go through the router and reach the other LAN. I can ping the interface of the router that is on the same side of the origin of the ping but not the other one. It's as if the router is acting like a wall of brick. As far as I can tell the configuration of the interfaces are fine and the IPs of the hosts are as well considering I can ping them within their own subnetworks. The switches seem to work as intended within their own network. I'm fairly new at networks and I've searched online without finding any fix that worked for me. At one point I was considering a default gateway problem but even if it is I don't know what I would have to do to fix it. IP addresses with their default gateways of all the elements
I've also looked at the Router0 "show ip route" but can't notice anything that could help me.
Hello Nathan Cournoyer,
It looks like the problem resides with your default gateway settings.
Let me go through the ip routing process for you (sort of).
Let's say PC1 wants to send an ICMP ping to PC3 in the other network (LAN2). So you type in PC1 terminal ping 192.168.2.145. PC1 is first going to determine whether routing is necessary by checking whether PC3 is on the link. According to PC1's IP address and subnet mask, PC1 determines that only hosts 192.168.1.1-254 (192.168.1.0/24) are on the link, therefore 192.168.2.145 is not on the link and routing is necessary. As a result, PC1 sends the ping packet to its default gateway for routing. You currently have 192.168.1.0 as your PC1 default gateway, which is incorrect in two ways. 1) PC1 cannot reach the router through this address because the Router0's interface on LAN1 is 192.168.1.127. 2) 192.168.1.0 is typically used as a subnet ID. I don't think it can be used to routing.
To solve your problem, you need to set the default gateway of both LANs' hosts to the router interface's IP on the same respective LAN.
I think the previous sentence is confusing. Let me detail your setup
Device
Interface
CIDR
Default Gateway
Router0
G0/0
192.168.1.127/24
G0/1
192.168.2.159/24
PC1
NIC
192.168.1.97/24
192.168.1.127
PC2
NIC
192.168.1.98/24
192.168.1.127
PC3
NIC
192.168.2.145/24
192.168.2.159
TFTP Server
NIC
192.168.2.146/24
192.168.2.159
For IPv6, it should be largely the same logic as IPv4.
I don't think you need to setup IP addresses for the switches, unless they need that for internal web servers and others. You can technically replace the router with a layer 3 switch. You may not need a full-blown router for inter-LAN routing.
I learn computer networking on my own, so my knowledge may be incomplete and/or incorrect. Please point out any problems.

How to communicate between different networks?

I have two PCs, as depicted in the figure.
Because of practical constraints, I cannot change anything on PC2, i.e., I cannot change its IP address and gateway (blank).
On both PCs, the subnet mask is '''255.255.255.0'''.
On PC1, I can only configure the gateway IP address.
Ideally, I would like both PCs to "think" they were communicating in the same network range (no gateways needed as far as the PCs were concerned).
Would this be feasible?
If yes, what kind of functionalities those routers must implement?
Ideally I want to be able from PC1 to
ping 192.168.1.11
and get responses from 192.168.2.11, i.e., the router(s) would handle all the address translation.
Thank you.
If you can't change PCs, it needs to be done on gateway.
Try changing the network mask from 255.255.255.0 to 255.255.0.0 (or from 24 to 16) on the routers (LAN interface).
If possible you could also change the network mask on PC.

Can you force a port forward without access to the router and UPNP probably turned off?

I want to port forward a port for my webserver on a router which i don't have access to. I highly doubt UPNP is enabled.
Actually, you can (sort of)
Its a bit complicated and wont work all the time, but here is the gist of how it works:
Given:
RouterA with public IP 1.2.3.4
PC1 with private ip a.b.c.d (behind router A)
RouterB with public IP 5.6.7.8
PC2 with private ip e.f.g.h (behind router B)
Now, given an IDEAL solution (i.e. no PAT)...
Step A:
Send any message from PC1 on any port (10000 for this example) to the public IP for RouterB (4.5.6.7). This will register a.b.c.d:10000 -> 4.5.6.7:10000 on the NAT and PAT for routerA. RouterB will discard this packet (as expected because it wasn't requested).
Step B:
At the same time, continuously send a packet from PC2 to the public IP of router A (1.2.3.4) on the same port (10000). This will register e.g.f.h:10000 -> 1.2.3.4:10000 on RouterB's NAT and PAT.
Step C:
Now, here is where the magic happens:
PC2 is constantly sending packet to RouterA thus keeping the 'hole' open in RouterB for a response to come back. When PC1 send it's single packet out to RouterB, it will appear to RouterB as a response and therefore will be forwarded to PC2. Once PC2 receives this 'response', make sure one more packet goes out and stop sending continuous packets. This last packet will act as 'response' to PC1 and go through the 'hole' created in Step A. And voila! You now have NAT transversal. You only need to send a single packet every minute or so both directions to keep the 'hole' open.
NOTE: This ONLY works with UDP as it is connectionless (dropped packets are ok).
Now almost ALL routers use PAT, so you have to 'guess' what port to 'respond' to most routers will do an offset of +-10 (i.e. a.b.c.d:10000 -> 5.6.7.8:10010).
Just try a few in that range (-10 to +10 until you get a response)
the rest of the routers are random on their PAT. If so, you're screwed... Try the other direction (i.e init the connection the other direction). If that fails, you cant connect... sorry)
So from what I understand, you have a web server running where things needs to be forwarded, and a router port which you don't have any access to; and you want to connect this two.
I highly doubt there is way to do this, if only you had sudo access to your router, you can use iptables to redirect

can some one explain communication between two clients in below network?

PC1 -> switch A -> switch B -> PC2.
Ip address of PC1 -192.168.2.1
Ip address of PC2 -192.168.2.2
if i ping PC2 from PC1, how will be the packet forwarded?
what will be the packets source ip address, destination ip address, source mac address and destination mac address at port connecting to PC1 and at port connecting to PC2 ?
You can omit switches between hosts, because they don't affect or modify any communication between hosts. They just store informations about what MAC address is reachable at what interface to reduce spamming network segments with useless data. Whole communication will be done in few steps:
PC1 want to send ICMP packet to PC2, but don't know his MAC address yet
network:: PC1: ARP - what is address of 192.168.2.2?
network:: PC2: ARP - address of 192.168.2.2 is aa:bb:cc:dd:ee:ff
PC1 has now L2 address, it can send packet
network:: PC1: ICMP echo-request - src-mac: 11:22:33:44:55:66, src-ip: 192.168.2.1 ... dest-mac: aa:bb:cc:dd:ee:ff, dest-ip: 192.168.2.2
PC2 recieves ICMP echo-request, and want to send echo-reply, but don't know L2 address of 192.168.2.1
network: PC2: ARP - what is address of 192.168.2.1?
network: PC1: ARP - address of 192.168.2.1 is 11:22:33:44:55:66
network: PC2: ICMP echo-reply - src-mac: aa:bb:cc:dd:ee:ff, src-ip: 192.168.2.2 ... dest-mac: 11:22:33:44:55:66, dest-ip: 192.168.2.1

Resources