HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Nat Gateway ??? help (http://www.howtoforge.com/forums/showthread.php?t=37499)

psykosen 16th July 2009 13:26

Nat Gateway ??? help
 
hey guys

I have a small problem I am about to put a new lan network together in my company! it is intended that the Internet connection goes into my (DHCP, PXE, File and print) server! These works perfect but I can not get internet to work! I have tried forwarding (eth0 => eth1) with iptables and it will not work(for me:confused:)

this is what I have tried!!

Quote:

echo 1 > /proc/sys/net/ipv4/ip_forward
then

To delete existing rules from every iptables table, execute the following commands:
Quote:


iptables -F
iptables -t nat -F
iptables -t mangle -F

Quote:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
and then i type "iptables -L" i get this output
Quote:

gate1:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
should it not show that it forwarded from eth0 => eth1
i'm not a guro in iptables so eny help is welcome
i'm totaly lost there:)

I have searched online for some days now and can not really find a solutions that works have tried this howto but without result
searched howtoforge for iptables, forwarding etc..
but nothing seem to work(mabe its me:( )

looked over my log files even trail -f whill the client boots up but now errors there

Regards
Psykosen

oh! i'm running Debian lenny with DHCP, PXE, File and Print server
and it works perfect nothing there

dipeshmehta 16th July 2009 14:07

try uncommenting following line in /etc/sysctl.conf
Code:

net.ipv4.ip_forward=1
hope this works.

Dipesh

psykosen 16th July 2009 16:24

no it did not work but thanks any way
it's for the first time I put such a system up so bear with me, only used linux for about 7 months

other proposals would be nice thanx again

fayax 20th July 2009 13:26

Try this and post the output.
Code:

iptables -L -t nat

psykosen 20th July 2009 19:18

hi this is the output off iptables -L -t nat

Code:

Chain PREROUTING (policy ACCEPT)
target              prot opt source                destination       

Chain POSTROUTING (policy ACCEPT)
target              prot opt source                destination 
MASQUERADE          all -- anywhere                  anywhere

Chian OUTPUT (policy ACCEPT)
target            prot opt source                destination

to me it's looks okay i meen it ACCEPTS all the way around????


All times are GMT +2. The time now is 02:04.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.