Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-21-2006, 08:28 PM
|
#1
|
Member
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152
Rep:
|
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.
|
|
|
04-21-2006, 09:29 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
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
|
|
|
04-21-2006, 10:46 PM
|
#3
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
What exactly is your problem? What can you not do?
|
|
|
04-22-2006, 09:56 AM
|
#4
|
Member
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152
Original Poster
Rep:
|
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.
|
|
|
04-22-2006, 10:55 AM
|
#5
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Did you try:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
|
04-22-2006, 04:47 PM
|
#6
|
Member
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152
Original Poster
Rep:
|
That is one of the lines in the firewall script
|
|
|
04-22-2006, 05:22 PM
|
#7
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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
|
|
|
04-22-2006, 07:25 PM
|
#8
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
04-22-2006, 11:32 PM
|
#9
|
Member
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152
Original Poster
Rep:
|
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.
|
|
|
04-23-2006, 12:41 AM
|
#10
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
What about the IP stuff - ifconfig output?
|
|
|
04-23-2006, 12:48 AM
|
#11
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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?
|
|
|
04-23-2006, 04:38 PM
|
#12
|
Member
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152
Original Poster
Rep:
|
When I type cat /proc/sys/net/ipv4/ip_forward it displays a 1.
|
|
|
04-23-2006, 04:42 PM
|
#13
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
04-23-2006, 05:11 PM
|
#14
|
Moderator
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
|
barn63 - I have changed your thread title to make it more descriptive.
|
|
|
04-23-2006, 11:58 PM
|
#15
|
Member
Registered: Jan 2006
Location: Macomb, IL
Distribution: Slackware 13.1
Posts: 152
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 08:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|