View previous topic :: View next topic |
Author |
Message |
Bastian9175 n00b
Joined: 11 Dec 2002 Posts: 29
|
Posted: Sun Jan 19, 2003 10:39 am Post subject: iptables question |
|
|
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 |
|
|
Matje l33t
Joined: 29 Oct 2002 Posts: 619 Location: Hasselt, Belgium
|
Posted: Sun Jan 19, 2003 11:51 am Post subject: |
|
|
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 |
|
|
Bastian9175 n00b
Joined: 11 Dec 2002 Posts: 29
|
Posted: Sun Jan 19, 2003 2:07 pm Post subject: |
|
|
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 |
|
|
Matje l33t
Joined: 29 Oct 2002 Posts: 619 Location: Hasselt, Belgium
|
Posted: Sun Jan 19, 2003 10:03 pm Post subject: |
|
|
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 |
|
|
|