View previous topic :: View next topic |
Author |
Message |
Azerix Guru


Joined: 19 Dec 2004 Posts: 346 Location: NL
|
Posted: Wed Jan 26, 2005 7:59 pm Post subject: Poort Forwarding....probleems |
|
|
Hallo
Usuali i had a normal DHCP, my gentoo was working fine as router and i had normal Internet conection. Today i want try IP forwarding, becouse i am using apache server.
So i try this code.
Quote: |
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth1 -j DNAT --to 192.168.0.56
|
And now i have no conenction on internet. I think i used wrong code, what do i have to do , to fix this probleem? How kan i remove that from iptables?
.My eth1 is dhcp it gets automatic IP from provider, en eth0 = 192.168.0.1 is static.
Thanks,
Azerix |
|
Back to top |
|
 |
Casper Gasper Tux's lil' helper

Joined: 07 Sep 2004 Posts: 75 Location: London
|
Posted: Wed Jan 26, 2005 8:49 pm Post subject: |
|
|
Err, not quite sure what you're trying to do! What do you mean by ip forwarding?
I can clearly see why your current web access is broken -- you're redirecting all traffic to port 80 to a machine on your local network.
Casper. |
|
Back to top |
|
 |
Azerix Guru


Joined: 19 Dec 2004 Posts: 346 Location: NL
|
Posted: Wed Jan 26, 2005 9:04 pm Post subject: |
|
|
ooh, , i do have intenet conection in router gentoo, i dont have inernet in other client that bount on network, but how can i undo this? i want my internet back  |
|
Back to top |
|
 |
Azerix Guru


Joined: 19 Dec 2004 Posts: 346 Location: NL
|
Posted: Wed Jan 26, 2005 9:55 pm Post subject: |
|
|
Can anyone help? i just want to undo, what i just did. |
|
Back to top |
|
 |
forbjok Apprentice


Joined: 21 May 2004 Posts: 207 Location: Hordaland, Norge
|
Posted: Wed Jan 26, 2005 10:25 pm Post subject: |
|
|
Just remove the rule you added, and things should be back to the way they were.
Code: | # iptables -t nat -D PREROUTING -p tcp --dport 80 -i eth1 -j DNAT --to 192.168.0.56 |
should do the trick. (-D is delete, instead of -A, which is add - if it finds a rule matching the specified criteria, it will be deleted, so this should delete the rule you added) |
|
Back to top |
|
 |
Azerix Guru


Joined: 19 Dec 2004 Posts: 346 Location: NL
|
Posted: Wed Jan 26, 2005 10:29 pm Post subject: |
|
|
i did that , is not working , i get this message :
Quote: |
iptables: Bad rule (does a matching rule exist in that chain?)
|
|
|
Back to top |
|
 |
Azerix Guru


Joined: 19 Dec 2004 Posts: 346 Location: NL
|
Posted: Wed Jan 26, 2005 11:18 pm Post subject: |
|
|
has anyone other ideas? |
|
Back to top |
|
 |
forbjok Apprentice


Joined: 21 May 2004 Posts: 207 Location: Hordaland, Norge
|
Posted: Thu Jan 27, 2005 12:11 am Post subject: |
|
|
It seems your rule was already removed then. If you had your rules saved in rules-save, try
Code: | # /etc/init.d/iptables reload |
that should re-read the setup from rules-save.
If it still doesn't work, try:
Code: | # iptables -t nat -L -v -n |
What shows up?
If your gateway is running NAT on the local network, there should be a MASQUERADE or SNAT rule in POSTROUTING.
Also, check that /proc/sys/net/ipv4/ip_forward is set to 1. Otherwise, it won't work. |
|
Back to top |
|
 |
|