LinuxQuestions.org
Register a domain and help support LQ
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 09-14-2007, 05:14 PM   #1
blueAlien
Member
 
Registered: May 2005
Location: Seattle, WA
Distribution: Slackware 13
Posts: 87

Rep: Reputation: 15
Slackware Router


I want to make my own router using an old computer and slackware. The hardware includes, two 10/100 nic cards and one dlink 802.11g wireless card. I want one nic (eth0) to use dhcp to obtain an ip address, the other nic (eth1) to have a static ip address of 10.0.0.1 and the wireless card (ath0) to have a static ip address of 192.168.1.1. A firewall should be implemented along with a dhcp server for other computers on the network to obtain their ip addresses.

Just wondering if anyone has taken on a similar projects, and what results you have had with different programs...

Thanks,
blue
 
Old 09-14-2007, 06:59 PM   #2
erklaerbaer
Member
 
Registered: Mar 2006
Posts: 381

Rep: Reputation: 30
should'nt be a problem, have a look at /etc/rc.d/rc.inet1.conf

for the dhcpserver i'd suggest dnsmasq and for the firewall http://www.slackware.com/~alien/efg/ might prove useful
 
Old 09-15-2007, 01:31 PM   #3
blueAlien
Member
 
Registered: May 2005
Location: Seattle, WA
Distribution: Slackware 13
Posts: 87

Original Poster
Rep: Reputation: 15
So how do I make that server act as a gateway also? What do I use to forward the internet? Does slackware 12 already have a dhcp server installed, or am I going to have to install one on my own?

Only thing I really know about setting up a server is apache, php, and mysql. I really don't even know where to start on anything else...

Thanks,
blue
 
Old 09-15-2007, 02:21 PM   #4
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I believe dnsmasq is a 'DNS forwarder and DHCP server', it is installed if you did a full install, if not, then install the package off the disk. Now, you do have to configure it properly.
 
Old 09-15-2007, 06:12 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,112
Blog Entries: 3

Rep: Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404
Quote:
Originally Posted by blueAlien View Post
So how do I make that server act as a gateway also? What do I use to forward the internet? Does slackware 12 already have a dhcp server installed, or am I going to have to install one on my own?

Only thing I really know about setting up a server is apache, php, and mysql. I really don't even know where to start on anything else...

Thanks,
blue
Hi,

You need to look at the Net-HOWTO to get some useful information.

You want basically a file server with NAT, firewall and services. This can be done easily with Slackware using the Net-HOWTO.

You could also reference a lot of links in 'Slackware-Links' which was compiled from 'Slackware LQ Suggestions Links!'.

You will find the quagga and zebra router projects listed in the network section of the above links if you just want to implement a router.
 
Old 09-16-2007, 07:31 AM   #6
coremp
LQ Newbie
 
Registered: Jan 2006
Location: newcastle, AU
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
make the following occur

1. install slackware to be in ip-forward mode. selectable at setup, or via making this file executable: /etc/rc.d/rc.ip_forward

2. add to /etc/rc.d/rc.local
eth0 gets IP via dhcpcd from your modem. put modem in half bridge mode for the linux box to do authenication, if you have permanent IP, do after initial setup. 1 step at a time!
/sbin/dhcpcd eth0

eth1 gives out IP's via dhcpd
/sbin/dhcpd eth1

run your filewall
/etc/rc.d/rc.firewall # get hold of a script on the net....somewhere!


3. add to /etc/revsolve.conf
put your gateway server address here if not doing authentication. else your isp DNS address
nameserver 10.0.0.34

4. add your dns server address to your /etc/dhcpd.conf file and your address range example:
ddns-update-style none;

option domain-name "blah.net";
option domain-name-servers xx.xx.xx.xx;

subnet 192.168.0.0 netmask 255.255.255.0 {
option netbios-name-servers 192.168.0.1;
option routers 192.168.0.1;
range 192.168.0.250 192.168.0.253;
}

that should get most of the way!!
been doing it this way for years.

Last edited by coremp; 09-16-2007 at 07:43 AM.
 
Old 09-30-2007, 03:42 PM   #7
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I had to setup my laptop here as a router for my brother's new gaming rig, and it was a real pain. So, now that I have it figured out, I'm gonna write here what I did so maybe it will help someone.

First lemme define a few things:
* I currently have a ppp connection to the internet (it kinda sucks, but the only other alternative is 56k), this connection is 'ppp0' (it uses a USB port, so I have my ethernet port free).
* I bought a long ethernet cable and ran it to my brother's computer (it runs BlueWhite64, and is setup to use DHCP for eth0, I used 'netconfig'), my computer connects to his also through interface 'eth0', but on my computer I didn't yet setup eth0.

So:
ppp0 is the external connection (connects to internet)
eth0 is the internal connection (connects to my bro's computer)

The steps I took are:
1) As coremp says, run:
Code:
chmod a+x /etc/rc.d/rc.ip_forward
(if you choose to run it now, rather than restart your computer, make sure to call it like '/etc/rc.d/rc.ip_forward start')

2) Go to Alien Bob's EFG and get a new 'rc.firewall' script:
http://www.slackware.com/~alien/efg/
For 'Internet Interface:' I put 'ppp0',
then when it says 'Single System or Private Network Gateway?', choose 'Gateway/Firewall', click 'generate firewall', and then put in your specs...
I put:
Internal Network Interface: eth0
Internal Network IP Address: 192.168.1.1
Internal Network: 192.168.1.0/24
Internal Network Broadcast: 192.168.1.255
then click 'generate firewall', and put the results in '/etc/rc.d/rc.firewall' and make it executable 'chmod a+x /etc/rc.d/rc.firewall'.
If you had another script in there, run '/etc/rc.d/rc.firewall stop', then '/etc/rc.d/rc.firewall start' (not sure if there's a restart option).

3) Now you must edit '/etc/dhcpd.conf', here's what mine looks like:
Code:
# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
ddns-update-style none;
subnet 192.168.1.0 netmask 255.255.255.0 {
	option domain-name-servers 84.247.48.3, 172.16.253.242;
	option broadcast-address 192.168.1.255;
	option subnet-mask 255.255.255.0;
	option routers 192.168.1.1;
	range 192.168.1.2 192.168.1.3;
	}
Note that your router's IP is '192.168.1.1', which can also be seen in the firewall script config in #2 above. The subnet is thus the same IP, but with a final '0', hence '192.168.1.0' (this can be seen in the firewall script above along with the type of network, 24 bits form the network, a Class C network). Netmask is the usual '255.255.255.0'. The domain-name-servers here are important, I got them from '/etc/resolv.conf':
Code:
nameserver 84.247.48.3
nameserver 172.16.253.242
The broadcast address is the same as the router IP, but with a final '255', hence '192.168.1.255' (this can also be seen in the firewall script above). Subnet-mask is same as netmask, '255.255.255.0'. And the IP range is up to you, since I will have at most 2 computers on my local network, I didn't make it very big, from '192.168.1.2' to '192.168.1.3'. Also note that 'ddns-update-style none;' is needed, or dhcpd will complain and fail to function.

4) Almost done, now just run:
Code:
ifconfig eth0 192.168.1.1
dhcpd eth0
the ifconfig is to assign yourself (the router) an IP of '192.168.1.1', which you can see in both step #2 and #3 above. Then we start the dhcp server, listening on eth0 for a call from my brother's computer ... probably 'dhcpcd eth0'. Note that you'll probably want to add these two commands to say '/etc/rc.d/rc.local' or somewhere similar, where they will get run on system startup.

That's it. But, don't think it was that easy. It didn't make sense for quite some time. It took me several hours to figure this out ... and I have a headache. Good luck.

Last edited by H_TeXMeX_H; 09-30-2007 at 03:57 PM.
 
  


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
Can slackware router get a virus? lord_emperor Linux - Software 7 06-30-2004 03:35 AM
making a router in slackware kmail Slackware 6 06-20-2004 09:12 PM
Configuring slackware behind a router jelth Linux - Software 3 02-14-2004 11:35 AM
Need Help with Slackware Router tweakedout Linux - Networking 2 08-13-2003 08:34 AM
slackware as a router RazorH Slackware 5 01-16-2003 03:26 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration