LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-08-2004, 10:44 AM   #1
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Rep: Reputation: 45
IP Forwarding + Jay's Firewall


Lo all,

After much reading, i learnt that you need to setup the adsl connection itself first, then a firewall or rule to forward to the rest of the computers in the LAN....

I got half of that working now. ADSL works on this linux machine... My problem is, i cant figure out how to let this box act as a gateway.

ADSL Setup
==============
After making sure i have all the files and kernel modules i need, i ran
adsl-setup
and entered everything, saved, and my adsl connection works like a charm.
However when it asked for "The firewall choice, at first i had it at "2 - MASQUERADE", but now i have it on "0 - NONE" (i assumed i dont need that firewall since i'll be using Jay's (firewall-jay.sourceforge.net)

If i run adsl-status i get this (incase this helps)
--------------------------------------------------------------------
adsl-status: Link is up and running on interface ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:212.118.14.130 P-t-P:212.118.14.11 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:54 (54.0 b) TX bytes:54 (54.0 b)
----------------------------------------------------------------------

Firewall Setup
================
After installing Jay's firewall, and configuring it, i still had no hope. The configuration is a bit too large to put it here, so i uploaded it to a site in angelfire, if you want to see it, here it is
http://www.angelfire.com/ok2/remember/firewall.config

I think i'm missing something, but i dont know what it is...

Layout and Info
=============
The adsl modem is connected to the switch, along with all the other computers
i connect to my modem through eth0
my gateway-to-be IP is 192.168.0.1
my other two machine's IPs are 192.168.0.2 and 192.168.0.7, both running XP (family...)
Kernel 2.4.22 (fresh install, will update to 23 or 24 when i fix this)
If i'm missing anything else, let me know.

Thanks alot guys, And If i did something wrong, or if there are better ways to do what im trying to do, please tell me.

Last edited by xushi; 01-08-2004 at 10:49 AM.
 
Old 01-08-2004, 10:57 AM   #2
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Just checked somthing... and its weird...

When on the other machines,
i cant ping outside the LAN (eg, google.com, bbc.co.uk)
i cant surf the web, or update my antivirus
msn messenger 6.1 wont connect

but

windows messenger connects.. ?!
 
Old 01-08-2004, 11:51 AM   #3
jc2it
LQ Newbie
 
Registered: Jan 2004
Posts: 29

Rep: Reputation: 15
I think you need to execute the route command to make a default gateway.

I am pretty sure this command is similar in *nix and Win$.

It is something like 'route default gw 0.0.0.0'

hope this points you in the right directiont at least.
 
Old 01-08-2004, 12:09 PM   #4
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
I think its already done. Here are the results when i type route

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
212.118.14.11 * 255.255.255.255 UH 0 0 0 ppp0
localnet * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 212.118.14.11 0.0.0.0 UG 0 0 0 ppp0
 
Old 01-08-2004, 01:00 PM   #5
Astro
Member
 
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665

Rep: Reputation: 30
I had a problem when I had a trial of AOL DSL.... seemed that for certain things I couldn't connect outside with... couldn't go to google.com couldn't go to certain other sites. When I used my xp machine for the gateway it worked fine. I'm guessing it was something to do with the slack machine and how I had the rp-pppoe set up though I'm not sure.
 
Old 01-08-2004, 03:33 PM   #6
jc2it
LQ Newbie
 
Registered: Jan 2004
Posts: 29

Rep: Reputation: 15
Xushi,
It looks fine to me (I am not an expert I have only done this once or twice), unless the ISP uses multiple gateways, or has different gateways for different blocks of IP addresses. You might call them to find out. They may have a machine name they want you to use instead of the IP address is what I am getting at.

Do you have a router? I tried pinging the IPs you listed but only your ISP gateway Did a DNS resolve. I also did went to www.samspade.org and tried the address and this is the result.

dns 212.118.14.130


212.118.14.130 has badly configured reverse DNS.

The reverse DNS for 212.118.14.130 is 130ip14.nets.com.jo, but 130ip14.nets.com.jo doesn't resolve to anything.

I would guess that the IP isn't registered yet. Your gateway resolves to 11ip14.nets.com.jo but rejects icmp. Perhaps your ISP blocks ping by default.

Your LAN should be able to ping your gateway. Unless the gateway isn't established on the XP boxes, or you listed 212.118.14.11 as the gateway instead of the 212.118.14.130.

I hope these ramblings help.
 
Old 01-08-2004, 05:32 PM   #7
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Thanks jc2it, some of this does make a bit of sense..

nets is my ISP, located in jordan (.com.jo)
When going back to XP, and checking the network settings, i notice that it says:
Server IP Address: 212.118.14.11
Client IP Address: 212.118.14.30

So i'm assuming when you tried pinging, you somehow did it on my modem, instead of the DNS Server..
the two DNS (212.118.0.1 212.118.0.2) i put in the configs up there i got from /etc/hosts.conf (and afaik, they are correct).

No i don't have a router here, its just the adsl ethernet modem connected to one of the ports in a switch, while the rest of the computers are connected to the other ports. Any computer can dial into the modem and become the gateway (from that setup), but i always let this machine do it, whether on XP or Slack, and assign the rest of the boxes to connect through this machine being the gateway, and yes they can all ping/see it. they just cant see through it =/

Anyway i'll call my ISP tomorrow, and double check on the DNS and Gateway, and ill keep this post updated.

Thanks again

Last edited by xushi; 01-08-2004 at 05:35 PM.
 
Old 01-08-2004, 08:40 PM   #8
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
Try this...

http://www.linuxquestions.org/questi...hreadid=121379
 
Old 01-09-2004, 05:05 AM   #9
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
bah... i used his script instead of jay-firewall ... i get exactly the same thing. Its driving me nuts now, i dont know what i'm doing wrong...

Both machiens can ping eachother, i (the server) can connect to the adsl, but he (the client trying to connect through me) cant... worst of all, his windows messenger can only and only that... not msn messenger, not internet browsing, not even pinging anything outside the LAN!?!?!
 
Old 01-09-2004, 08:22 AM   #10
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
One of the nasty things about scripts is all the extra "fluff" around the rules...

Better to list the active rules on your screen with iptables-save and start dissecting it from there.
Sometimes rules don't get loaded...

I suspect the MASQUERADE isn't working.
 
Old 01-09-2004, 09:51 AM   #11
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
here is a completely open firewall... if this doesn't get you going, then iptables isn't the problem. I strongly suggest you only use this for testing as it doesn't provide any protection.

Quote:
#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
ipt=/sbin/iptables

# Change this value to your EXTERNAL interface
ext=eth0

# Set policies
$ipt -P INPUT ACCEPT
$ipt -P FORWARD ACCEPT
$ipt -P OUTPUT ACCEPT

# Delete table rules, chains and counters
for table in filter nat mangle
do
$ipt -t $table -F # flush
$ipt -t $table -X # delete
$ipt -t $table -Z # zero
done

$ipt -t nat -A POSTROUTING -o $ext -j MASQUERADE
 
Old 01-09-2004, 09:56 AM   #12
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
edit...
 
Old 01-10-2004, 05:07 AM   #13
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Ok please be patiant with me... =]

edited...
---------------------------
sorry i got confused..
after searching, i realised i dont have /proc/.../ip_forward.

Anyway I created a script with the firewall above changing two lines to
echo "1" > /etc/rc.d/rc.ip_forward
ipt=/usr/sbin/iptables
ext=ppp0
executed it, but still nothing =/
---------------------------------
peter_robb, here's the output of iptables-save

# Generated by iptables-save v1.2.8 on Sat Jan 10 13:06:48 2004
*mangle
:PREROUTING ACCEPT [476:153732]
:INPUT ACCEPT [473:153562]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [443:62799]
:POSTROUTING ACCEPT [443:62799]
COMMIT
# Completed on Sat Jan 10 13:06:48 2004
# Generated by iptables-save v1.2.8 on Sat Jan 10 13:06:48 2004
*nat
:PREROUTING ACCEPT [34:2632]
:POSTROUTING ACCEPT [30:1801]
:OUTPUT ACCEPT [30:1801]
COMMIT
# Completed on Sat Jan 10 13:06:48 2004
# Generated by iptables-save v1.2.8 on Sat Jan 10 13:06:48 2004
*filter
:INPUT ACCEPT [33:2601]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [443:62799]
COMMIT
# Completed on Sat Jan 10 13:06:48 2004

Last edited by xushi; 01-10-2004 at 05:14 AM.
 
Old 01-11-2004, 11:41 AM   #14
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
That iptables-save list shows that there are no active rules..!

Do it again after the script has run..
If you get the same output, you will have to run the script line by line to find the errors...

Usually, to get nothing, something important in the beginning of the script is wrong..
 
Old 01-11-2004, 02:38 PM   #15
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Thanks, yes i typed iptables-save after the script, ill run it line by line soon, but i just want to ask something to make sure of it..

When setting up my ADSL connection with adsl-setup
when it asks me what firewall do i want to put and gives me 3 choices
0 - none
1 - single user
2 - masquerading.

Which one shall i choose for now? shall i put it on 2, or shall i choose 0 and work on the scripts i'm trying out (jay's, or the others)?

Thanks
 
  


Reply



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
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Allow specific hosts with iptables (jay's firewall) TheOneAndOnlySM Linux - Networking 2 04-04-2004 06:52 PM
configure jay's firewall to use dns in /etc/resolv.conf TheOneAndOnlySM Linux - Software 0 03-29-2004 07:27 PM
Firewall with ip forwarding axis Slackware 0 08-28-2003 08:47 PM
firewall port forwarding manthram Linux - Networking 0 04-01-2002 07:08 PM

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

All times are GMT -5. The time now is 04:26 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