title: Programmatically port forwarding using c#
body: <p>i need to run a wcf service in our office server and want to access that service from out side of office. i test the wcf service in LAN and it is working fine. our office has static ip. some one told me that port forwarding is required to access that wcf service from out side of office. i have no access to our office routine and that is why i can enter into router &amp; can not forward any port from there. so i have decided i have to do port forwarding programmatically by c#. so looking for guidance which library i can use to do port forwarding using c#.</p>
  
  <p>if i do not know the router login then a c# program can enable port forwarding ? i like to also know what port forwarding does ? does it save any data in router or any pc?</p>
  
  <p>guide me in details how can i enable port forwarding for my wcf service if i do not have access office router and want to enable the access of wcf service running in a office pc from out side ? looking for great discussion. thanks</p>
  
  <h2>updated</h2>
  
  <p>i have found one link <a href="http://pietschsoft.com/post/2009/02/NET-Framework-Communicate-through-NAT-Router-via-UPnP.aspx" rel="noreferrer">http://pietschsoft.com/post/2009/02/NET-Framework-Communicate-through-NAT-Router-via-UPnP.aspx</a></p>
  
  <p>it is using com comonet for port forwarding. i have confusion about the picture they have shown. please have a look and tell me. here is the pic.
  <img src="https://i.stack.imgur.com/dYuPS.png" alt="enter image description here"></p>
  
  <p>according to the pic we need to mention external ip, external port and internal ip &amp; port.
  if my wcf service is running on port 7756 then do i need to specify the same port for external &amp; internal port?</p>
  
  <p>what ip i need to specify as external &amp; internal IP?
  if machine ip is 192.168.6.2 where my wcf service is running locally and if our office static ip is 122.160.187.236 then how i need to specify ip's for external &amp; internal purpose? please help me with information. thanks</p>