Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
 |
01-24-2002, 09:24 PM
|
#1
|
LQ Newbie
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13
Rep:
|
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
|
|
|
01-25-2002, 12:22 AM
|
#2
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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-25-2002 at 12:25 AM.
|
|
|
01-25-2002, 12:52 AM
|
#3
|
LQ Newbie
Registered: Jan 2002
Posts: 13
Rep:
|
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
|
|
|
01-25-2002, 05:12 AM
|
#4
|
Member
Registered: Jul 2001
Location: London
Distribution: RH 9
Posts: 151
Rep:
|
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
|
|
|
01-25-2002, 08:33 AM
|
#5
|
Member
Registered: Dec 2001
Distribution: redhat
Posts: 154
Rep:
|
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.
|
|
|
01-26-2002, 05:27 PM
|
#6
|
LQ Newbie
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13
Original Poster
Rep:
|
 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?
|
|
|
01-26-2002, 08:54 PM
|
#7
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
depends on your installation, maybe you don't have it.
|
|
|
01-26-2002, 10:50 PM
|
#8
|
Member
Registered: Dec 2001
Distribution: redhat
Posts: 154
Rep:
|
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.
|
|
|
01-26-2002, 11:52 PM
|
#9
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
run setup
then select system services
look for ipchains or iptables
you need to enable one of them only.
|
|
|
01-27-2002, 07:09 AM
|
#10
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
01-27-2002, 07:05 PM
|
#11
|
LQ Newbie
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13
Original Poster
Rep:
|
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
|
|
|
01-29-2002, 01:09 AM
|
#12
|
LQ Newbie
Registered: Jan 2002
Posts: 3
Rep:
|
Is there a graphical util that i can use to set up ip chains?
|
|
|
01-29-2002, 03:58 AM
|
#13
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
that's what i said, firestarter.
y'know when i see VPN written down i still instantly read VPL. [visible panty line] tsk...
|
|
|
01-29-2002, 08:20 AM
|
#14
|
LQ Newbie
Registered: Mar 2001
Location: Marlborough, MA
Distribution: RedHat 7.2
Posts: 13
Original Poster
Rep:
|
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
|
|
|
01-29-2002, 07:30 PM
|
#15
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
when it fails to start it tells you the name of the log file to look in for info. Check that file out.
|
|
|
All times are GMT -5. The time now is 05:08 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
|
|