Coder Social home page Coder Social logo

ptbridge's Introduction

ptbridge

This tool makes it possible to bridge traffic between virtual packet tracer networks and real networks. Therefore it translates packets and keeps states for the protocol translation. Sadly packet tracer packets and protocols are different to real ones which makes it difficult to translate them and inflexible. So there is only a handful of protocols implemented and these could be unstable.

It is not possible to pass generic data through pt networks, like usually over ip, tcp or udp.

Supported protocols

  • Ethernet
  • IP
  • UDP
  • TCP
  • ARP
  • ICMP
  • DHCP (broken)
  • Telnet

Usage

To use this tool you need to setup a linux vm on your host os. For this I used VirtualBox and Ubuntu. Then you will need a bridged interface in the vm to the network you want ptbridge to be connected. In the vm ptbridge needs to be started as root due to low level network access.

Then you need to setup packet tracer for multiuser connection. There are alot tutorials and videos about this on the internet. The packet tracer instance need to be in server mode. Try the connection with a second packet tracer instance. After that, you can connect the ptbridge to packer tracer.

The usage of this tool should be self explanatory: ./ptbridge.jar <interface> <pt_ip>:<pt_port> <password>

ptbridge's People

Contributors

andiwand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ptbridge's Issues

Not able to ping

Hi I am able to recieve the packets over my packet tracer 7 but along with some errors when i try to ping:
java.lang.NullPointerException
at at.stefl.ptbridge.ptmp.multiuser.pdu.MultiuserUDPSegment.getBytes(MultiuserUDPSegment.java:33)
at at.stefl.ptbridge.ptmp.multiuser.pdu.MultiuserIPv4Packet.getBytes(MultiuserIPv4Packet.java:84)
at at.stefl.ptbridge.ptmp.multiuser.pdu.MultiuserEthernet2Frame.getBytes(MultiuserEthernet2Frame.java:50)
at at.stefl.ptbridge.ptmp.multiuser.packet.MultiuserNetworkPacket.getValue(MultiuserNetworkPacket.java:79)
at at.stefl.ptbridge.ptmp.packet.PTMPPacket.getBytes(PTMPPacket.java:75)
at at.stefl.ptbridge.ptmp.packet.PTMPPacket.getBytes(PTMPPacket.java:80)
at at.stefl.ptbridge.ptmp.packet.PTMPPacketWriter.writePacket(PTMPPacketWriter.java:94)
at at.stefl.ptbridge.ptmp.PTMPConnection.send(PTMPConnection.java:246)
at at.stefl.ptbridge.ptmp.multiuser.MultiuserConnection.sendImpl(MultiuserConnection.java:286)
at at.stefl.ptbridge.ptmp.multiuser.MultiuserConnection.send(MultiuserConnection.java:279)
at at.stefl.ptbridge.ptmp.multiuser.MultiuserLinkAdapter.send(MultiuserLinkAdapter.java:44)
at at.stefl.ptbridge.traverser.EthernetTraverser.sendToMultiuserLink(EthernetTraverser.java:102)
at at.stefl.ptbridge.traverser.EthernetTraverser.access$2(EthernetTraverser.java:100)
at at.stefl.ptbridge.traverser.EthernetTraverser$EthernetReceiver.run(EthernetTraverser.java:27)

What can be the reason behind such errors ?

not able to execute Jar executable

@andiwand can you please explain with an example because i tried with ptbridge.jar like : java -jar ptbridge.jar then it says Exception in thread "main" java.net.NoRouteToHostException: No route to host (Host unreachable)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:580)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.(Socket.java:429)
at java.net.Socket.(Socket.java:242)
at at.stefl.ptbridge.ptmp.PTMPConnection.connect(PTMPConnection.java:160)
at at.stefl.ptbridge.main.Main.main(Main.java:58)
Please help me !

Commands not found with usage

usage: [ <pt_ip>:<pt_port> ]

default: eth0 192.168.15.101:38000 cisco
root@prateek-desktop:~/ptbridge-master# eth0 192.168.15.192:38000 cisco
eth0: command not found

Please explain how to call and also is there anz need to call the ptbridge.jar using java -jar command ?

Routing implementation with ptbridge

Hi.. I have connected my PC to my packet tracer instance via ptbridge. I can ping from outside world to inside world. In my packet tracer environment I have a wireless router and few IOT devices connected to it. the ssid of that router is Default.
In outside world I have a Lynksys wireless router (internet enabled) connected to my laptop and PC via DHCP having SSID: linksys. From my laptop I can ping the IOT devices inside Packet tracer environment. But now I want to see if it is possible or nor somehow to connect my IOT devices to linksys router rather than the one which is inside packet tracer with SSID: Default. or Outside world devices like my laptop and PC to have dhcp address from Inside world router with SSID: Default rather than linksys router.

Please Help.

-z noexecstack

Hello, I try to connect my Raspberry PI to Cisco Packet Tracer 7. I've downloaded you program to the Raspberry pi and try to connect PT on my Desktop. But during starting ptbridge I got the following Error:

Java HotSpot(TM) Client VM warning: You have loaded library /tmp/packetsocket866569321805906031 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

So may be include the -z noexecstack option in the build Script may be solved the problem? Can you rebuild the jar with this option?

best regards

jtuttas

jar file exec cformat error

@andiwand Hi.. I am working over PTBridge for my master thesis topic and thanks for your guidance so far... but I need a bit more help of yours. while i was runnning the caommand as shown below as per your guidance..

prateek@prateek-desktop:~/ptbridge-master$ ./ptbridge.jar eth1 192.168.15.192:38000 cisco

The output gives an error :

bash: ./ptbridge.jar: cannot execute binary file: Exec format error

Please help me resolving the same at the earliest It is creating an hindrance in my thesis work.

Regards,
Prateek

Errors running the sytax

Exception in thread "main" java.lang.ExceptionInInitializerError
at at.stefl.ptbridge.main.Main.main(Main.java:49)
Caused by: java.lang.IllegalStateException: Unsupported operating system!
at at.stefl.packetsocket.NativeLibraryLoader.load(NativeLibraryLoader.java:31)
at at.stefl.packetsocket.EthernetSocket.(EthernetSocket.java:78)

I am Trying to run the following command "java.exe -jar ptbridge.jar" and it gave me above posted error. can you please guide me resolving the same.

Regards ,
Prateek Manocha

Passing only layer 2 traffic

Hi,

image

Topology in Packet Tracer
image
Router1 g0/0 interface is 192.168.56.1
image
enps08 is 192.168.56.103
image
Virtualbox Host-Only is 192.168.56.2
image

Capturing host-only interface proves ARP request/reply when pinging but no layer 3 traffic...
image

Any ideas?

Thank you,
James

VirtualBox Version 6.1.2 r135662
Ubuntu 18.04.4 LTS
Packet Tracer 7.3.0.0838

eRRORS IN BETWEEN THE CONNECTION

java.lang.NullPointerException
at at.stefl.ptbridge.ptmp.multiuser.pdu.MultiuserUDPSegment.getBytes(MultiuserUDPSegment.java:33)
at at.stefl.ptbridge.ptmp.multiuser.pdu.MultiuserIPv4Packet.getBytes(MultiuserIPv4Packet.java:84)
at at.stefl.ptbridge.ptmp.multiuser.pdu.MultiuserEthernet2Frame.getBytes(MultiuserEthernet2Frame.java:50)
at at.stefl.ptbridge.ptmp.multiuser.packet.MultiuserNetworkPacket.getValue(MultiuserNetworkPacket.java:79)
at at.stefl.ptbridge.ptmp.packet.PTMPPacket.getBytes(PTMPPacket.java:75)
at at.stefl.ptbridge.ptmp.packet.PTMPPacket.getBytes(PTMPPacket.java:80)
at at.stefl.ptbridge.ptmp.packet.PTMPPacketWriter.writePacket(PTMPPacketWriter.java:94)
at at.stefl.ptbridge.ptmp.PTMPConnection.send(PTMPConnection.java:246)
at at.stefl.ptbridge.ptmp.multiuser.MultiuserConnection.sendImpl(MultiuserConnection.java:286)
at at.stefl.ptbridge.ptmp.multiuser.MultiuserConnection.send(MultiuserConnection.java:279)
at at.stefl.ptbridge.ptmp.multiuser.MultiuserLinkAdapter.send(MultiuserLinkAdapter.java:44)
at at.stefl.ptbridge.traverser.EthernetTraverser.sendToMultiuserLink(EthernetTraverser.java:102)
at at.stefl.ptbridge.traverser.EthernetTraverser.access$2(EthernetTraverser.java:100)
at at.stefl.ptbridge.traverser.EthernetTraverser$EthernetReceiver.run(EthernetTraverser.java:27)

aFETR FEW ERRORS AGAIN i RECEIVE

| 2058 | 0 | 0 | 255 | 6 | 0 | 192.168.0.135 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 000A.F392.CB58 | 0 | 2048 |

462425953 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1195 | 31000 | 0 | 1 | 0 | 0 | 15 | 4 | -1 | 0 | 0 | 0 | 0 | 4 | 5 | 0 | 40 | 2057 | 0 | 0 | 255 | 6 | 0 | 192.168.0.122 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 000C.CF4B.548E | 0 | 2048 |

502516859 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1195 | 31000 | 0 | 1 | 0 | 0 | 15 | 4 | -1 | 0 | 0 | 0 | 0 | 4 | 5 | 0 | 40 | 2060 | 0 | 0 | 255 | 6 | 0 | 192.168.0.106 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 0009.7C0E.D547 | 0 | 2048 |

900234035 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1195 | 31000 | 0 | 0 | 0 | 0 | 15 | 2 | -1 | 0 | 1 | TcpOptionMSS | 2 | 0 | 1460 | 0 | 0 | 4 | 5 | 0 | 44 | 2057 | 0 | 0 | 255 | 6 | 0 | 192.168.0.133 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 0004.9AC9.E862 | 0 | 2048 |

785179512 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1200 | 31000 | 0 | 0 | 0 | 0 | 15 | 2 | -1 | 0 | 1 | TcpOptionMSS | 2 | 0 | 1460 | 0 | 0 | 4 | 5 | 0 | 44 | 2124 | 0 | 0 | 255 | 6 | 0 | 192.168.0.124 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 0030.A3B3.77E2 | 0 | 2048 |

949786550 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1195 | 31000 | 0 | 1 | 0 | 0 | 15 | 4 | -1 | 0 | 0 | 0 | 0 | 4 | 5 | 0 | 40 | 2059 | 0 | 0 | 255 | 6 | 0 | 192.168.0.136 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 000B.BEB8.6CD1 | 0 | 2048 |

411314317 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1195 | 31000 | 0 | 1 | 0 | 0 | 15 | 4 | -1 | 0 | 0 | 0 | 0 | 4 | 5 | 0 | 40 | 2110 | 0 | 0 | 255 | 6 | 0 | 192.168.0.108 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 00E0.A368.12C9 | 0 | 2048 |

1824926386 | 0 | EthernetIIHeader | IpHeader | TcpHeader | | 1195 | 31000 | 0 | 1 | 0 | 0 | 15 | 4 | -1 | 0 | 0 | 0 | 0 | 4 | 5 | 0 | 40 | 2058 | 0 | 0 | 255 | 6 | 0 | 192.168.0.133 | 192.168.10.2 | 0 | 0 | 0023.692F.270B | 0004.9

What can be the probable reason behind this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.