LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2001, 02:00 PM   #1
Dayewalker
LQ Newbie
 
Registered: Nov 2001
Location: Texas
Distribution: Redhat 7.2
Posts: 23

Rep: Reputation: 15
DHCP and IP Masquerading on Redhat 7.2


Is there an easy way to set up a DHCP server and configure IP Masquerading when installing Redhat 7.2 in order to share an internet connection with a computer running Windows 98 SE? I know it's possible to do it after installation, but I need to be able to have the network setup and the internet connection shared ASAP after having Redhat installed because the other computer depends on the internet connection from my computer. Thanks in advance for any info.
 
Old 12-13-2001, 02:45 PM   #2
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 58
I know the hard way, its pretty quick, but its a ton of command line stuff...

Go to the RedHat (lack of) knowledge database and look for "simple IP masq iptables". You might try google.com/linux too. You'll eventually find one that's pretty quick and has enough for full Masq and at least a minimum of protection.

Learn IPtables when you have time. I have to stress this... learn IPtables...

Okay, enough security brainwashing, You'll copy that file into /etc/rc.d, calling it something like rc.firewall. Using the text editor of your choice add the line /etc/rc.d/rc.firewall to the end of /etc/rc.d/rc.local This will bring up the firewall, and all the forwarding associated with it at boot.

Second, dhcpd...
Take this:

subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;

# option nis-domain "Ilikecheese.net";
# option domain-name "Ilikecheese.net";
option domain-name-servers xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx;

option time-offset -5; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
range dynamic-bootp 192.168.0.10 192.168.0.240;
# default-lease-time 21600;
# max-lease-time 43200;
}
uncomment out what you need, change it to your LAN's internal setup. I assume you're going by 192.168.0.1 for your RH machine. This one is also cool because it assigns the dynamics to above 192.168.0.10 so that if you drop more linux boxes on the LAN, you give them .2-.9. Change the xxx's to your nameserver's IPs. What are they? cat /etc/resolv.conf

copy that as /etc/dhcpd.conf

to invoke the dhcp daemon (bad pun), /sbin/dhcpd ethX -cf /etc/dhcpd.conf

Actually, if you are using eth0 as your connection to the LAN, just type dhcpd as /sbin should be in root's path, /etc/dhcpd.conf is the default location for the file, and eth0 is assumed as the default card. However, its always best to tell it exactly. You can stick that same thing in rc.local too, above the firewall line would be best.

Cheers,

Finegan
 
Old 12-13-2001, 03:41 PM   #3
Dayewalker
LQ Newbie
 
Registered: Nov 2001
Location: Texas
Distribution: Redhat 7.2
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks a LOT! I'm in class right now but as soon as I get home I'm gonna try it.
 
Old 12-13-2001, 04:01 PM   #4
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 58
More IP masq garbage.

The tome of ]masq'ing .

Oh, and I got bored and found one that is very quick and dirty. Learn Tables soon, learn tables soon, learn ip tables soon. Alright, with that said, try

this. .

Cheers,

Finegan
 
Old 12-14-2001, 04:02 PM   #5
zhenwu
Member
 
Registered: Jul 2001
Location: Taiwan (ex-Victoria BC)
Distribution: RH 9.0
Posts: 126

Rep: Reputation: 15
Or get endoshield from Freshmeat.net, tweak it (rather easy, not too hard and lets you set up all sorts of stuff), and your masq'ing is up and running.

But i have a question for you: why would you need to run dhcp? Why not just specify an internal address for your windows machine, and use your internal IF (eth1 for example) as your gateway.
 
Old 12-16-2001, 01:23 AM   #6
Dayewalker
LQ Newbie
 
Registered: Nov 2001
Location: Texas
Distribution: Redhat 7.2
Posts: 23

Original Poster
Rep: Reputation: 15
More or less I just want to play with DHCP and learn to configure and use it as opposed to just manually configuring the NIC's in the different machines. I know it's easier that way, but what's the fun in that? :
 
Old 12-16-2001, 01:37 AM   #7
zhenwu
Member
 
Registered: Jul 2001
Location: Taiwan (ex-Victoria BC)
Distribution: RH 9.0
Posts: 126

Rep: Reputation: 15
Good answer!
 
  


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
XP Pro Build 2600/sp1 v.1105 DHCP Client to Redhat 8.0 DHCP Server - Problems atomant Linux - Networking 5 06-28-2003 12:24 PM
DHCP in Redhat adriandaz Linux - Networking 1 06-08-2003 01:18 AM
NTP and DHCP in RedHat 7.3 observer_il Linux - Distributions 0 05-13-2003 04:57 AM
Redhat 9 and DHCP/Routing Morthoseph Linux - Networking 7 04-26-2003 06:41 PM
DHCP help in Redhat Draxus Linux - Networking 4 01-02-2003 11:21 PM


All times are GMT -5. The time now is 11:08 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration