So this is a higher level problem I'm having, and I'm trying to wrap my head around it. I have a program that sends out a broadcast ethernet packet (it is stripped down using the Pcap.Net dll). If the device listens to the broadcast, it will respond to me with another Ethernet packet.
My setup:
My PC IP is : 10.10.3.109 (DHCP)
My Gateway: 10.10.1.254
If I broadcast an ethernet packet at this point to 255.255.255.0 I get responses from 10.10.0.x to 10.10.1.x
My Goal:
I want to set up my environment so that I can send this broadcast packet can reach my office's 10.10.5.x and 10.10.4.5.x network with a gateway of 10.10.5.254 from my computer on the different network (I didn't number the networks, so I apologize if they're confusing. .4/.5 are the same network)
So my question is, what do I need to do in my vb, or my environment so that when I send this packet, both networks are heard?
What I have tried:
Obviously, Ethernet isn't going to talk to other subnet on its own. What I have read is that you can create routes through your router using the command like. For example:
route ADD 10.10.4.254 MASK 255.255.255.0 10.10.3.109
It ran successfully, but when I run the program I don't get any response from other networks. What am I missing in my setup to make this work?
My VB Code:
For funsies (based of pcapdotnet example):
' Open the output device
Dim Communicator As PacketCommunicator = selectedOutputDevice.Open(65536, PacketDeviceOpenAttributes.None, 500)
Dim filter As BerkeleyPacketFilter = Communicator.CreateFilter("len >= 415 and len <= 417")
Communicator.SetFilter(filter)
' send broadcast packet
Communicator.SendPacket(BuildEthernetPacket(ReqInfoPkt, "ff:ff:ff:ff:ff:ff"))
You can't.
Ethernet doesn't know or care about protocols on higher levels, including IP. IP doesn't always run over Ethernet. They're separate things.