Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Poort Forwarding....probleems
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
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Wed Jan 26, 2005 7:59 pm    Post subject: Poort Forwarding....probleems Reply with quote

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
View user's profile Send private message
Casper Gasper
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2004
Posts: 75
Location: London

PostPosted: Wed Jan 26, 2005 8:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Wed Jan 26, 2005 9:04 pm    Post subject: Reply with quote

ooh, 8O , 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 :wink:
Back to top
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Wed Jan 26, 2005 9:55 pm    Post subject: Reply with quote

Can anyone help? i just want to undo, what i just did.
Back to top
View user's profile Send private message
forbjok
Apprentice
Apprentice


Joined: 21 May 2004
Posts: 207
Location: Hordaland, Norge

PostPosted: Wed Jan 26, 2005 10:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Wed Jan 26, 2005 10:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Wed Jan 26, 2005 11:18 pm    Post subject: Reply with quote

has anyone other ideas?
Back to top
View user's profile Send private message
forbjok
Apprentice
Apprentice


Joined: 21 May 2004
Posts: 207
Location: Hordaland, Norge

PostPosted: Thu Jan 27, 2005 12:11 am    Post subject: Reply with quote

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
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