LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-26-2005, 08:18 PM   #1
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Rep: Reputation: 30
Some questions on Setting up a Router/Gateway


Hi - I have a gateway with two ethernet cards.
I would one (eth0) to use DHCP to get the internet and its name servers etc,
and I would like the second one to run Samba, NFS and DHCP (for the
rest of the computers on the network).

I have not understood how to tell one interface eth0 to do DHCP and the other,
eth1 to be static at 192.168.0.1 - how do I do this! Can I run dhcpd with a rule to
configure itself???

After we have solved the static IP problem,
I would like to know, how do I get the machine to act as a gateway?

Thanks,
Riddick
 
Old 09-26-2005, 08:41 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
you can tell dhcpd to only listen on eth0 by specifying at runtime:
Code:
dhcpd eth0
the configuration for dhcpd is done in /etc/dhcpd.conf...

remember that:

DHCPD = dhcp daemon

DHCPCD = dhcp client daemon

DHCPD is what will serve IPs to your LAN... DHCPCD is what will request an IP for eth0 from your ISP's DHCP server...

as for the IPs, it's simple... configure eth0 to use DHCP (how you do this depends on your distro) and make eth1 have a static IP...
Code:
ifconfig eth1 inet 192.168.0.1 netmask 255.255.255.0
of course you should use your NIC's configuration file instead of running ifconfig directly, although the effect is the same if you don't reboot...

to make your box act as a gateway, you need to activate forwarding:
Code:
echo "1" > /proc/sys/net/ipv4/ip_forward
but you should really study iptables before you do any forwarding:

http://iptables-tutorial.frozentux.n...-tutorial.html

read-up on SNAT and MASQUERADE....

just my ...


Last edited by win32sux; 09-26-2005 at 08:43 PM.
 
Old 09-27-2005, 05:24 PM   #3
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Original Poster
Rep: Reputation: 30
I like the 2cents! Excellent I got it working!
This is an excellent resource, even though I am running slackware:

http://www.aboutdebian.com/

Thanks for everything,
Riddick
 
  


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
Router Gateway inescapeableus Linux - Networking 11 09-21-2005 10:39 AM
router-gateway-AP? bigearsbilly Linux - Wireless Networking 1 01-28-2005 07:47 AM
Setting up Router/Default Gateway with Redhat 9.0 Tutorial bmfmyth Linux - Networking 3 08-31-2004 03:47 PM
setting my router as the default gateway TheOneAndOnlySM Linux - Networking 10 03-27-2004 06:12 PM
Gateway/router bjojoi Linux - Networking 0 06-16-2003 06:19 AM

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

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