Programmatic Router Port Mapping

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 124256
    New Member
    • Mar 2007
    • 6

    #1

    Programmatic Router Port Mapping

    I'm working on some peer-to-peer stuff and I need to make this service available to those behind routers. Two things need to be accomplished:

    1. Detect whether or not the user is behind a router.
    2. If the user is behind a router, forward port X to the user's network IP.

    I've seen this done using COM and C, but I can't translate into C#.

    Thanks!
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    One way to possibly detect if they are behind a router is to see if their local IP address is the same as the ip visible to the outside world. Not a garuntee, but I'd say 9/10 times it will be accurate.

    If you program is going to punch a hole through a router firewall, it's probably done with (insert protocol name I can't think of right now, "SNMP" I think?), which not all routers support and most people leave the feature turned off.

    Comment

    Working...