Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Bastian9175
n00b
n00b


Joined: 11 Dec 2002
Posts: 29

PostPosted: Sun Jan 19, 2003 10:39 am    Post subject: iptables question Reply with quote

Can make redirect 22 port from my computer to other computer.
I`m behind router and i want to make this iptables rule on this router.
Back to top
View user's profile Send private message
Matje
l33t
l33t


Joined: 29 Oct 2002
Posts: 619
Location: Hasselt, Belgium

PostPosted: Sun Jan 19, 2003 11:51 am    Post subject: Reply with quote

Your English wasn't that clear, but I think I understand ;-)
These are the rules I use to enable port forwarding:

Code:
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 22 -j DNAT --to 192.168.0.x:22
iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.x --dport 22 -j ACCEPT

eth0 is connected to the internet, replace the x with the ip of the computer where you want to redirect to.
_________________
Life is like a box of chocolates... Before you know it, it's empty...
Back to top
View user's profile Send private message
Bastian9175
n00b
n00b


Joined: 11 Dec 2002
Posts: 29

PostPosted: Sun Jan 19, 2003 2:07 pm    Post subject: Reply with quote

all of this 3 computer is on the internet but

scheme
------ my computer
router <
------ other computer

every one has public ip but only my computer is not firewalled.
And i want for example: ssh mycomputer and this router redirect connections to other computer.
Back to top
View user's profile Send private message
Matje
l33t
l33t


Joined: 29 Oct 2002
Posts: 619
Location: Hasselt, Belgium

PostPosted: Sun Jan 19, 2003 10:03 pm    Post subject: Reply with quote

I'm really not understanding this :-) Is the router a linux server? Or is it such a modem which delivers two ip's to the connected computers ? If I'm guessing right this time, you want to redirect the public (internet) port 22 on your computer to the public port 22 of the other computer? Is this through a second ethernet adapter or through the same? Your scheme isn't very clear ;-)
_________________
Life is like a box of chocolates... Before you know it, it's empty...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum