LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2002, 08:24 PM   #1
quincy56
LQ Newbie
 
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13

Rep: Reputation: 0
Unhappy Linux as a gateway/router Why is it so difficult?


I have a computer attached to my cable modem. It has two nic cards. One is attached to the cable modem and the other is attached to my local lan. I have it set up to dual boot to Windoze 98SE and Linux (RedHat 7.2). I was able to set up IP sharing with W98 with just a few mouse clicks and it works just fine. With Linux I can get to the net from the Linux system, but trying to make it serve as a DHCP server and route my internal network has been a royal pain. I'm not that interested in any fancy firewall, I don't have any thing worth hacking. Just a simple script or wizard to get me on my way...

John
 
Old 01-24-2002, 11:22 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
router ...
commands...

ipchains -P forward DENY
ipchains -A forward -i eth0 -j MASQ
echo 1 > /proc/sys/net/ipv4/ip_forward

ip setup command...
ifconfig eth1 192.168.0.1 netmask 255.255.255.0


dhcp....

config file....
/etc/dhcpd.conf

authoritative;
default-lease-time 32400;
max-lease-time 64800;

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.100;
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 111.111.111.111, 222.222.222.222;
option domain-name "HOME";
option netbios-scope "";
}



command...

dhcpd eth1


substitute your own ip numbers. And your dns

Last edited by DavidPhillips; 01-24-2002 at 11:25 PM.
 
Old 01-24-2002, 11:52 PM   #3
qweqwe
LQ Newbie
 
Registered: Jan 2002
Posts: 13

Rep: Reputation: 0
let me tell u ..first time its always difficult ..that too if u are used to the GUI of windows ...but once u set it up ..its so easy nextime onwards ..i too had Win2k as my gateway ..but after code red i replaced with RH 6.2 on a 32 MB box ..its works so cool ..worth all the pains and effort in setting up a Linux box..

-qweqwe
 
Old 01-25-2002, 04:12 AM   #4
glj
Member
 
Registered: Jul 2001
Location: London
Distribution: RH 9
Posts: 151

Rep: Reputation: 30
Im running RH 7.2, and installed it as a server option in the install. I'm going to set it up as a DHCP server for house LAN, but don't have dhcpd installed (although I do have dhcpcd). What package do I need to install to get the server, as opposed to the client?

Cheers

glj
 
Old 01-25-2002, 07:33 AM   #5
theFuzzyOne
Member
 
Registered: Dec 2001
Distribution: redhat
Posts: 154

Rep: Reputation: 30
dchp
rh7.2 comes with the file dhcp-2.0pl5-8.i386.rpm on the cdroms

or you can just do a 'up2date dchp' to d/l it.
 
Old 01-26-2002, 04:27 PM   #6
quincy56
LQ Newbie
 
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13

Original Poster
Rep: Reputation: 0
Unhappy

I am making some progress. I started with a clean install, and both ethernet interfaces are working. I can get to the internet with no problems from the Linux system. I can also telnet to the Linux system from my local (192.168.0.x) network. I still can't seem to get the system to be a DHCP server (the client part seems to work OK) and I also can't start ipchains. It says 'Protocol not supported'.

Any ideas?
 
Old 01-26-2002, 07:54 PM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
depends on your installation, maybe you don't have it.
 
Old 01-26-2002, 09:50 PM   #8
theFuzzyOne
Member
 
Registered: Dec 2001
Distribution: redhat
Posts: 154

Rep: Reputation: 30
you may not have the dhcp server installed... do a 'rpm -qa' to get a list of every rpm package installed, or do a 'rpm -qa | grep dhcp' to see if you have dhcpd installed.
 
Old 01-26-2002, 10:52 PM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
run setup

then select system services

look for ipchains or iptables

you need to enable one of them only.
 
Old 01-27-2002, 06:09 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
by far the easiext way to set up a gateway is to just use a prog called firestarter, it uses the basic ip_forward and iptables thing as suggested above, but more securely and much easier. eratinly in a much nicer, faster way than windows. that connection sharing crap in windows is horrific.
 
Old 01-27-2002, 06:05 PM   #11
quincy56
LQ Newbie
 
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13

Original Poster
Rep: Reputation: 0
Smile

I wanted to thank everyone for the help, I'm accessing this through my Linux system now.

One problem though. I also have a need to run a VPN client from inside. I found some info on the net, but it has not seemed to help. I'm sure I'm missing something simple. Is there an easy way to determine what ports the VPN client is? I'm using a Cisco program version 3.1.

Thanks.

John
 
Old 01-29-2002, 12:09 AM   #12
tg518
LQ Newbie
 
Registered: Jan 2002
Posts: 3

Rep: Reputation: 0
Is there a graphical util that i can use to set up ip chains?
 
Old 01-29-2002, 02:58 AM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's what i said, firestarter.

y'know when i see VPN written down i still instantly read VPL. [visible panty line] tsk...
 
Old 01-29-2002, 07:20 AM   #14
quincy56
LQ Newbie
 
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13

Original Poster
Rep: Reputation: 0
Talking

Thanks for the advise Chris. Yesterday I installed Firestarter. I saw in the startup scripts that it would blow away all my current ipchain settings when it started. I figured that would be Ok. Well when I re-booted last night, and tried to start up my desktop X session, it would not start. So I had to go ahead and do the ipchains commands again from the command line. Guess what? This time everything worked including VPN!

So now all I have to do is figure out why my system doesn't like my X setup. I ran Xconfigurator till I was blue in the face.

John
 
Old 01-29-2002, 06:30 PM   #15
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
when it fails to start it tells you the name of the log file to look in for info. Check that file out.
 
  


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
How can I add a second gateway to my linux router? abefroman Linux - Networking 1 11-20-2005 11:45 AM
Using Linux as a gateway with hardware router spudtheimpaler Linux - Networking 1 08-22-2005 01:39 PM
Linux box as a gateway/router dooda5555 Linux - Networking 2 04-29-2005 01:06 PM
Using Linux as an internet router / gateway bashworth Linux - Networking 2 09-10-2004 06:00 PM
gateway for a linux router?? jmono Linux - Networking 12 11-17-2003 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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