ef99 PF firewall setting for network programming - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Firewalls

Firewalls IPFW, PF, IPF (but not limited) related discussion

Reply
 
Thread Tools Display Modes
  #1  
Old April 13th, 2012, 02:52
Vitamin Vitamin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 37
Thanks: 7
Thanked 0 Times in 0 Posts
Default PF firewall setting for network programming

Network programming newb.....just playing around with some code I found online.

The port that the program is listening on is 3490, in the PF firewall manager, what service should be selected with port 3490 to ensure proper communication during a telnet session? Should I set up telnet for outgoing and incoming via port 3490?

Below is the pic of my firewall manager



I'm using emacs, if that helps

Last edited by DutchDaemon; April 13th, 2012 at 21:41.
Reply With Quote
  #2  
Old April 13th, 2012, 07:29
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

OS-X related questions should be asked on an OS-X forum.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old April 13th, 2012, 11:28
Vitamin Vitamin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 37
Thanks: 7
Thanked 0 Times in 0 Posts
Default

I'm not using OS-X
Reply With Quote
  #4  
Old April 13th, 2012, 21:43
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,861
Thanks: 30
Thanked 1,896 Times in 1,338 Posts
Default

The service name comes from /etc/services. Port 3490 is not bound to a service name. So either put a name in there and use that, or keep using 'Unknown'. Note that the large majority of people here use /etc/pf.conf, where you don't need to define a name like that, though you can (e.g. 'port 22' and 'port ssh' are equivalent)..
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #5  
Old April 13th, 2012, 23:55
Vitamin Vitamin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 37
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Thanks for the reply.

The "Unknown" service entry in the picture I attached. It changes from telnet to unknown after a while. What would happen is, telnet session will connect, but I cannot communicate during session. I don't see the customized welcome message for each new accepted connection that is in the program. I type in the telnet window, but the program doesn't receive the message.

If I do netstat -a I see the Recv-Q with bytes of pending data, but Send-Q is empty. I executed different programming projects, from different websites, but same results. So I assume that my firewall settings are to blame.

Last edited by DutchDaemon; April 14th, 2012 at 00:55.
Reply With Quote
  #6  
Old April 14th, 2012, 00:59
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,861
Thanks: 30
Thanked 1,896 Times in 1,338 Posts
Default

Assuming you're running the program yourself and want to allow traffic from the outside in (and assuming it runs on the pf machine), a pf rule would look like this. Can't help you with any firewall managers, I don't use any.

Code:
pass in quick on em0 inet proto tcp from any to em0 port 3490 keep state flags S/SA
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---

Last edited by DutchDaemon; April 14th, 2012 at 04:42.
Reply With Quote
  #7  
Old April 14th, 2012, 03:16
Vitamin Vitamin is offline
Junior Member
 
Join Date: Jan 2012
Posts: 37
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Thanks, added it, but still have the problem of having a successful telnet session connection, but not being able to send or receive messages. I will go to the development section for programming specific questions.

Last edited by DutchDaemon; April 14th, 2012 at 04:41.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[PF] Poor network performance with PF firewall pva Firewalls 4 October 9th, 2011 16:19
Setting up home network Frozen001 Installing & Upgrading 5 June 1st, 2011 13:42
Setting up firewall using IPFW Mimmo91 Firewalls 3 October 14th, 2010 06:31
advice setting up a network k2msmith Networking 6 April 27th, 2009 06:09
No network without open firewall. What am I missing? fredBSD Networking 2 March 18th, 2009 05:46


All times are GMT +1. The time now is 00:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0