Emuforums.com

Go Back   Emuforums.com > General Discussion > Software Discussion
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old June 15th, 2006   #1 (permalink)
RF
Canadian Spaceman
 
RF's Avatar
 
Join Date: May 2002
Location: Canada
Posts: 8,594
Linux Iptables

How could I block everything but 1.2.3.4 on port 3389 with iptables?

I am running dd-wrt on my router (linux based), and need to allow one ip, 1.2.3.4 (example). Everything else needs to be blocked on port 3389. This will restrict only my own ip address access to remote desktop connections.

Thanks
__________________
RF is offline   Reply With Quote
Old June 15th, 2006   #2 (permalink)
Registered User
 
Join Date: Jun 2006
Location: Brazil
Posts: 4
>: )

Man... i must really be drunk lol... subscribed only to answer you haha
Hope you are a chick : D
Try this: (hope you are talking about incoming traffic)

iptables -A INPUT -p tcp -s 0/0 -d THE_ROUTER_IP --dport 3389 -j DROP
iptables -I INPUT -p tcp -s 1.2.3.4 -d THE_ROUTER_IP --dport 3389 -j ACCEPT
iptables -A INPUT -p udp -s 0/0 -d THE_ROUTER_IP --dport 3389 -j DROP
iptables -I INPUT -p udp -s 1.2.3.4 -d THE_ROUTER_IP --dport 3389 -j ACCEPT

that must be the job. THE_ROUTER_IP i think its pretty obvious, refers to the ip it is configured for the router : )
Typoon is offline   Reply With Quote
Old June 15th, 2006   #3 (permalink)
RF
Canadian Spaceman
 
RF's Avatar
 
Join Date: May 2002
Location: Canada
Posts: 8,594
Quote:
Originally Posted by Typoon
Man... i must really be drunk lol... subscribed only to answer you haha
Hope you are a chick : D
Try this: (hope you are talking about incoming traffic)

iptables -A INPUT -p tcp -s 0/0 -d THE_ROUTER_IP --dport 3389 -j DROP
iptables -I INPUT -p tcp -s 1.2.3.4 -d THE_ROUTER_IP --dport 3389 -j ACCEPT
iptables -A INPUT -p udp -s 0/0 -d THE_ROUTER_IP --dport 3389 -j DROP
iptables -I INPUT -p udp -s 1.2.3.4 -d THE_ROUTER_IP --dport 3389 -j ACCEPT

that must be the job. THE_ROUTER_IP i think its pretty obvious, refers to the ip it is configured for the router : )
Awesome, much appreciated. Just for you I am a very sexy babe
__________________
RF is offline   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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 21:28.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5