LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-21-2006, 08:28 PM   #1
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Rep: Reputation: 17
IP Settings for a Server and Router


Sorry in advance for asking because I know this question gets asked alot but I am at my wits end and need any help I can get. I want to set up a slackware server that acts as a DHCP server as well as a Router. The computer has a 700 mhz P3, 384 mb ram, 30 gb hard drive, and 2 3Com Nics. eth0 gets assigned an IP address by my ISP(through DSL) and eth1 has a static address 192.168.0.1/24. I don't know what to do because its my first time attempting to set up a slackware server. I tried to use the script here as well as following the guide here. All I have tried to do has been a failure. Can someone explane to me the process of how to set up the router. I have the DHCP server running and its assings IPs. Here is the conf file.

subnet 192.168.0.1 netmask 255.255.255.0 {
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.0.255;
option router 192.168.0.1;
option domain-name-servers 192.168.0.1;
option netmask 255.255.255.0;
range 192.168.0.50 192.168.0.150;
}

The DHCP server seems to work fine but the router doesn't. If someone can help me set up the router that would be great. Sorry again for asking this question but help is needed.
 
Old 04-21-2006, 09:29 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hard to help you not knowing how you modified the iptables-script.
You DID modify it, didn't you?

In your case obviously
ext=eth0
and
int=eth1


Cheers,
Tink
 
Old 04-21-2006, 10:46 PM   #3
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
What exactly is your problem? What can you not do?
 
Old 04-22-2006, 09:56 AM   #4
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
What I can't do is get the computer to act as a router. I have tried chmod +x /etc/rc.d/rc.ip_forward. Then starting it. I have tired to use the firewall script from here. I did modify the script so that ext=eth0 and int=eth1. I also changed the line "ipt=/sbin/iptables" to "ipt=/usr/sbin/iptables" because /sbin/iptables gave an error. I just don't know the process of setting up a router and what I have tried didn't work. I tried to follow the directions from the link here. Any help would be appriciated. Thanks and sorry for asking a repetive question again.

Last edited by barn63; 04-22-2006 at 10:02 AM.
 
Old 04-22-2006, 10:55 AM   #5
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Did you try:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
 
Old 04-22-2006, 04:47 PM   #6
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
That is one of the lines in the firewall script
 
Old 04-22-2006, 05:22 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I only spent about 30 secs looking at the firewall script, but as it stands, it looks like only port 22 (ssh) is open, so are you sure that everthing isn't perfectly OK exccept that you're blocking traffic you actually want?

Try adding port 80 to the line

tcp_ports="22"

I assume space delimited, but to be honest, I'm not sure

Applogies if you already did this, but soemtimes it helps to point out the obvious because it can be easy to miss
 
Old 04-22-2006, 07:25 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Just to let you know, I tried the script out on the box I use as a router, and it works as is, except of course I set "ext" and "int" to suit.

Try running the script, then post the output from iptables -L.

Also, what user are you running the script as? What are the IP addresses of eth0 and eth1 (I assume for eth1 you meant 192.168.0.1, mask 255.255.255.0)? Perhaps post the output of ifconfig as well.

Does /sbin/iptables exist on your system? If so, what error did you get when you ran with this setting?

Last edited by billymayday; 04-22-2006 at 07:34 PM.
 
Old 04-22-2006, 11:32 PM   #9
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
Here is the output from iptables -L

Chain BAD_IP (7 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 1/sec burst 3 LOG level error prefix `IPT: BAD IP: '
DROP all -- anywhere anywhere

Chain EXT_FIREWALL (1 references)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
SPOOF all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW
LOG all -- anywhere anywhere limit: avg 1/sec burst 3 LOG level error prefix `IPT: EXT_FIREWALL: '
DROP all -- anywhere anywhere

Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
INT_FIREWALL all -- anywhere anywhere
EXT_FIREWALL all -- anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source destination
IN_NETWORK all -- anywhere anywhere
OUT_NETWORK all -- anywhere anywhere

Chain INT_FIREWALL (1 references)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere

Chain IN_NETWORK (1 references)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
SPOOF all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT udp -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 1/sec burst 3 LOG level error prefix `IPT: IN_NETWORK: '
DROP all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain OUT_NETWORK (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 1/sec burst 3 LOG level error prefix `IPT: OUT_NETWORK: '
DROP all -- anywhere anywhere

Chain SPOOF (2 references)
target prot opt source destination
BAD_IP all -- 0.0.0.0/8 anywhere
BAD_IP all -- 10.0.0.0/8 anywhere
BAD_IP all -- loopback/8 anywhere
BAD_IP all -- 169.254.0.0/16 anywhere
BAD_IP all -- 172.16.0.0/12 anywhere
BAD_IP all -- 192.168.0.0/16 anywhere
BAD_IP all -- 255.255.255.255 anywhere

Also there is no /sbin/iptables. When I ran the script i get the error. /sbin/iptables: no such file or directory.
 
Old 04-23-2006, 12:41 AM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What about the IP stuff - ifconfig output?
 
Old 04-23-2006, 12:48 AM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Also, if you type

cat /proc/sys/net/ipv4/ip_forward

Does it give you "1" (after running the script?

Which user are you running this as?
 
Old 04-23-2006, 04:38 PM   #12
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
When I type cat /proc/sys/net/ipv4/ip_forward it displays a 1.
 
Old 04-23-2006, 04:42 PM   #13
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Again, can you post the ifconfig output.

More importantly though, can you access anything through your IPS from the machine you are trying to use as a router? ie - is it the routing that's the issue of the connection in some form.
 
Old 04-23-2006, 05:11 PM   #14
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
barn63 - I have changed your thread title to make it more descriptive.
 
Old 04-23-2006, 11:58 PM   #15
barn63
Member
 
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152

Original Poster
Rep: Reputation: 17
Here is what I did today. I reinstalled Slackware and set up the DHCP server(which appears to be working fine). From the server I could connect to the outside world via FTP and telnet. I ran the firewall script (after I changed the int and ext to suite my needs and changed /sbin/iptables to /usr/sbin/iptables)and that caused the connection to the outside world to halt and nothing works anymore from my server. I am going to, tomorrow after I get out of class, to reinstall everything, start ip_forward and see if my client machines can connect to anything. If so then I will re-run the script and see what happens(if I get the same results). I will post the ifconfig output tomorrow. Thanks for changing the name and any help so far.
 
  


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
find all settings on my router cyb0rg777 Linux - Networking 7 12-27-2005 05:01 PM
how to config. network settings for having a static ip with a router kkeith Linux - Newbie 2 10-19-2005 05:00 AM
Are these DDoS Defense Router Settings correct ? Rayen16 Linux - Security 3 04-10-2005 10:15 AM
How to access router settings without M$ software? Vincent_Vega Linux - Hardware 2 01-30-2004 07:42 PM
Need help with network settings and router evanmac Linux - Networking 3 03-14-2003 12:40 AM

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

All times are GMT -5. The time now is 10:11 PM.

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