LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-27-2006, 06:26 AM   #1
tiuz
Member
 
Registered: Mar 2006
Distribution: Slackware 14
Posts: 92

Rep: Reputation: 15
IP Forwarding wonīt work


Hello,

I want to use my box with Slackware 10.2 as a gateway for my localnet (192.168.0.0), so far everything looks fine, iptables -L nat shows this:

Chain PREROUTING (policy ACCEPT)
target prot opt source destination

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

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain eth1_masq (1 references)
target prot opt source destination
MASQUERADE all -- borsti.ISS/24 anywhere

borsti.ISS is the local domain.

However when i try to connect to the internet on a client (for example using ping) i can see the correct IP-Address of the "host" i ping but i just get "Host is down"
When i ping from the gateway everything works fine.

Any ideas,
Thanks,
tiuz
 
Old 04-27-2006, 09:37 AM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
Have you made sure that you turned IP Forwarding on in your gateway? I think that would be the first issue. Also I would look at the policies and output of the FORWARD chain. Hope this helps!
 
Old 04-27-2006, 11:46 AM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Code:
#chmod +x /etc/rc.d/rc.ip_forward
#sh /etc/rc.d/rc.ip_forward start
regards,
...drkstr
 
Old 04-27-2006, 11:50 AM   #4
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
sorry to repost, but I wanted to give you an example of a basic IPtable set up that works as a gateway:

Code:
#Flush Current Ruleset
 iptables -F
 iptables -t nat -F

#Setup Default Polocies
 iptables -P INPUT ACCEPT
 iptables -P OUTPUT ACCEPT
 iptables -P FORWARD DROP

#Create Device Variables
 export LAN=eth1
 export WAN=eth0

#Lock Services to Only Work From Lan
 iptables -I INPUT 1 -i ${LAN} -j ACCEPT
 iptables -I INPUT 1 -i lo -j ACCEPT
 iptables -A INPUT -p UDP --dport bootps -i ! ${LAN} -j REJECT
 iptables -A INPUT -p UDP --dport domain -i ! ${LAN} -j REJECT

#Open Needed Ports
 iptables -A INPUT -p TCP --dport ssh -i ${WAN} -j ACCEPT

#Drop TCP / UDP Packets to Privileged Ports
 iptables -A INPUT -p TCP -i ! ${LAN} -d 0/0 --dport 0:1023 -j DROP
 iptables -A INPUT -p UDP -i ! ${LAN} -d 0/0 --dport 0:1023 -j DROP

#NAT Rules
 iptables -I FORWARD -i ${LAN} -d 192.168.0.0/255.255.0.0 -j DROP
 iptables -A FORWARD -i ${LAN} -s 192.168.0.0/255.255.0.0 -j ACCEPT
 iptables -A FORWARD -i ${WAN} -d 192.168.0.0/255.255.0.0 -j ACCEPT
 iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE
hope this helps.
...drkstr
 
Old 04-27-2006, 04:00 PM   #5
tiuz
Member
 
Registered: Mar 2006
Distribution: Slackware 14
Posts: 92

Original Poster
Rep: Reputation: 15
IP Forwarding is on, i have made sure that /etc/rc.d/ip_forward is set to 755 and "restarted" it by hand, so this is up.
I rechecked the NAT table again but canīt find anything that would go wrong with it.
 
Old 04-27-2006, 08:20 PM   #6
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Quote:
I rechecked the NAT table again but canīt find anything that would go wrong with it.
I am by no means an expert in networking, but shouldn't you have a FORWARD policy set up?

for instance 'iptables -L':

...
Chain FORWARD (policy DROP)
target prot opt source destination
DROP all -- anywhere 192.168.0.0/16
ACCEPT all -- 192.168.0.0/16 anywhere
ACCEPT all -- anywhere 192.168.0.0/16
...
I didn't see anything set up for this chain on your first post.

regards,
...drkstr
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make wonīt work/ dial up connection brase Mandriva 1 03-04-2006 07:37 AM
BootP won;t work but DHCP will rhaley Linux - Networking 1 06-10-2005 11:37 AM
Cronjob won`t work in /var nodger Linux - Software 3 11-02-2004 06:44 PM
Boot screen won,t work help!!!!!! drysac Mandriva 4 11-02-2004 12:07 PM
Why won’t this Java Script Work? dholingw Programming 4 02-25-2004 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration