Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Gproxy software in my computer(Ubuntu 12.10). I want to allow incoming connection from only one IP adress,so that he can use internet. what settings should I configure in ufw firewall.

share|improve this question
IS the connection a local (192.168.*, 10.0.*) or a public IP? What port is Gproxy listening on? – Thomas Ward Nov 8 '12 at 13:29
Yes,local connection. Port : 5123 – Madhu Prudhvi Raj Nov 8 '12 at 14:02
I provided an answer below that should work for the UFW rules. I also provided the iptables equivalent for more technical people, feel free to ignore everything below the horizontal line in my answer. (If you had said a public IP, i'd be asking you quite a few more questions before giving an answer :P) – Thomas Ward Nov 8 '12 at 15:27

For UFW, you should make an Inbound rule which will allow you to accept connections via port 5123 (probably TCP and UDP).

sudo ufw allow proto tcp from [SourceIP] port 5123 should be sufficient for what you need, it'll open port 5123.

For the record, and for those who use iptables directly in case you are curious, the same functionality can be obtained with this:

sudo iptables -A INPUT -p tcp -s [SourceIP] --dport 5123 -j ACCEPT
share|improve this answer
to restrict access to a single ip add ` from <IP>` to the ufw command; a more complete example: sudo ufw allow proto tcp from port 5123 – Tom Regner Nov 8 '12 at 15:28
Thanks, updated accordingly. Although if it needs UDP, they'll need to add a rule to allow for UDP too. (I use iptables, hence the iptables equivalent rules being included) – Thomas Ward Nov 8 '12 at 15:30
Thanks alot to every1 for helping me – Madhu Prudhvi Raj Nov 8 '12 at 15:59
@MadhuPrudhviRaj don't forget to mark an answer as accepted if it helped. – Thomas Ward Nov 9 '12 at 13:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.