LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-03-2008, 02:56 PM   #1
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Rep: Reputation: 15
Smile Cable modem


Hi people,

Could anyone help for this situation.

I have got a cable modem and 2 nics in ubuntu server.

1st -> when I connect the cable modem to one nic it catch the ip defined by ISP.

I've got a DHCP in the same machine so in my /etc/network/interfaces

auto eth0
iface eth0 inet dhcp

I've got eth0 ha dhcp. (when I try to restart dhcp it gets an error because eth0 (by syslog))

So I 've done the following
/usr/sbin/dhcp eth1

To start dhcp to the 2 nic.

2nd -> My DHCP configuration is something like this

subnet 192.168.1.0
range 192.168.1.1 192.168.1.255
mask 255.255.255.0
option router 192.168.1.2

and Network interfaces /etc/network/interfaces

auto eth1
iface eth1 inet static
address 192.168.1.3
subnetmask 255.255.255.0
gateway 192.168.1.1

I don't know if this is the best way to have dhcp making attribution to all the machines that I have and have the internet to all of them.

If could anyone help that would be cool.
 
Old 01-04-2008, 05:55 AM   #2
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Help

Hi people,

Is there anyone who could help ?
 
Old 01-04-2008, 08:43 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
It's hard to understand the situation, can you try to clarify:

1) How many computers are your trying to get internet for, including the server ?
2) How many NICs does each computer have, again including server ?
 
Old 01-04-2008, 09:31 AM   #4
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Computers

Thnaks for awnsering to me

1) 4 computers ina local network (1 NIC for each)

2) The computers have only one nic but I've got a hub and the server has got 2 nics

1 internet connection and one for local network.

Thanks
 
Old 01-04-2008, 12:57 PM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Your config does not look right. You seem to be assigning your router a static IP that overlaps with the DHCP range, which means some machine might be assigned it and you'll have two computers with the same IP (a no-no). Also, you seem to want to give your router an internal IP of 192.168.1.3 but in your DHCP config you tell other machines on the LAN that the router has 192.168.1.2, so they will not get the correct gateway. Finally I'm not sure where 192.168.1.1 is coming in as the gateway for this machine. The default gateway should be your ISP's default gateway, as this is an Internet facing machine.
 
Old 01-04-2008, 04:59 PM   #6
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Internet IP

The internet IP it's dynamic.

And What I intent to do it's something like this.

1 - Connect PC to one ethernet on server the other nic serve the local area network

2- I must give a route to the default gateway of internet and to local area network

3- the second ethernet uses a dhcp that only works with local area network.

thanks
 
Old 01-04-2008, 05:47 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You should understand DHCP is nothing but configuration helper for boxes on your LAN. Your router has to do NAT to pass internet to LAN, or at least you should run a proxy and DNS cache for this to work. Computers on LAN can be configured manually or using DHCP, it does not matter.
 
Old 01-04-2008, 06:20 PM   #8
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
You actually are needing 2 diffrent things here a DHCP client and a DHCP server. The server would be needed to assign your computers on your network addresses and the client would be needed to obtain a net address for your cable modem. Also as mentioned before you would need to do NAT to get internet working on yoru internal computers. Look into iptables to do this pretty simply.


I hope this helps.


The DHCP client that I use is DHCPCD
 
Old 01-04-2008, 07:28 PM   #9
uffe2
Member
 
Registered: Dec 2007
Posts: 59

Rep: Reputation: 15
Why are you using the server as a NAT gateway/Firewall ?
...or was it with purpose you use the server as a Firewall ?
Is it not easier and better to buy a simple NAT gateways instead for $40 ? (e.g. Netgear)
What is the reason you have placed the server between Internet and your PC's ?
Or do you only get one dynamic IP-address from your ISP ?

Last edited by uffe2; 01-04-2008 at 07:29 PM.
 
Old 01-04-2008, 07:36 PM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you don't have a nat router, you will need to configure a host with two nic interfaces. You will need to configure the firewall to masquerade IP addresses for the lan hosts. You will also need to run a dhcp server for the lan. The second NIC IP address will be supplied by the dhcp server as the gateway address of the LAN.

Like a previous poster stated, it would be easier to purchase a cable/dsl NAT router. It would also have a switch for the LAN which would give you better performance than a hub.
 
Old 01-04-2008, 07:44 PM   #11
uffe2
Member
 
Registered: Dec 2007
Posts: 59

Rep: Reputation: 15
Yes, but if your ISP delivery 5 IP-addresses with DHCP (without any extra cost) why are you using a NAT ?
I try to identify the real problem....
May he want to protect his PC with a Firewall ?
Then it's even better to use a real firewall ( not onle a NAT) with e.g. protocol filtering.

/Uffe2

PS
My ISP delivery 5 IP address as default


Quote:
Originally Posted by jschiwal View Post
If you don't have a nat router, you will need to configure a host with two nic interfaces. You will need to configure the firewall to masquerade IP addresses for the lan hosts. You will also need to run a dhcp server for the lan. The second NIC IP address will be supplied by the dhcp server as the gateway address of the LAN.

Like a previous poster stated, it would be easier to purchase a cable/dsl NAT router. It would also have a switch for the LAN which would give you better performance than a hub.

Last edited by uffe2; 01-04-2008 at 07:45 PM.
 
Old 01-04-2008, 10:22 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
His first post implies a single dynamic IP address. He can post whether that isn't the case.
Also, a cable modem will only connect to a single device with a certain MAC address. If connecting it to another device it needs to be registered with the new device before getting internet access. If he want's do dedicate a host for a firewall rather than using a NAT router that is fine. If he want's to run proxy servers or an HID as well, more power to him.
 
Old 01-05-2008, 07:57 AM   #13
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool First of all

Hi people,


First off all, let me to be thankful to all who have posted to help me in this journey.

I intent to do with cable modem and 2 nics to have local network and internet. Without more equipment.

But I need to know how to do it, so I will need a step by step or a little patient from someone who could explain to me something related with back posts.

I'm curious about and I probably could make some good questions and others probably not in the mood.

But in the first phase I just need to make connection from cable modem, configure a DHCP server (and probably a client for the internet) to get to go.

Then in the second phase I would like to have a firewall on the local network (with iptables or firestarter whatever the best scheme)and this would be in the same server.

That's the ideia that I have probably with some opinion I could change something but that's what I intented to do for now and to open the knowledge with linux.

If there is some step by step or if someone has the steps to do this (or the order that could be done) it would be a great help.

Thanks once again to all.
 
Old 01-05-2008, 10:38 AM   #14
uffe2
Member
 
Registered: Dec 2007
Posts: 59

Rep: Reputation: 15
Post

Sorry, I missed that you only have one public dynamic IP-address !

A solution:

1) Use your server as a NAT gateway.
2) Connect one NIC card to the modem (or Internet)
(defined as the NAT-servers WAN interface)
3) Connect the other NIC card to a switch with serveral Ethernet ports
(defined as the NAT-servers LAN interface)
4) Connect all other PC's to the switch
5) Install a DHCP-server and DHCP-client software on your server
5) The servers WAN interface should be defined as a DHCP-client
(the DHCP client should get one public IP-address
from the ISP with DHCP when the server start up)
6) The server LAN interface should be defined as a DHCP-server
(the DHCP-server on the LAN interface delivery
private IP-addresses to all your PC's)
(=>one unique private IP-address for each PC)
7) Configure the DHCP server (on your servers LAN interface)
7.1 Set a private IP-address of the servers LAN interface
(e.g. 192.168.0.100
7.2 Set a subnet mask (e.g. 255.255.255.0)
7.3 Definde a scope of private IP-address to your servers DHCP-server
(e.g. 192.168.0.10-192.168.0.99).
7.4 Set a default gateway to the LAN interfaces IP-address
(e.g. 192.168.0.100)
 
Old 01-05-2008, 12:00 PM   #15
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Smile

Thanks for the help being helded .

1) Use your server as a NAT gateway.Is there a way to define this ?

2) Connect one NIC card to the modem (or Internet)
(defined as the NAT-servers WAN interface) How could be define the NAT-servers as WAN interface ?Is it defined on the /etc/network/interfaces file ?

3) Connect the other NIC card to a switch with serveral Ethernet ports
(defined as the NAT-servers LAN interface) How could be define the NAT-servers LAN interface ? Is it defined on the /etc/network/interfaces file ?

4) Connect all other PC's to the switch Done

5) Install a DHCP-server and DHCP-client software on your server I think I can handle with this.

5) The servers WAN interface should be defined as a DHCP-client
(the DHCP client should get one public IP-address
from the ISP with DHCP when the server start up)So my problems start in here, this is defined on the dhcp or in other local ?

6) The server LAN interface should be defined as a DHCP-server
(the DHCP-server on the LAN interface delivery
private IP-addresses to all your PC's)
(=>one unique private IP-address for each PC)Ok here I think with this I could define where dhcp will work /usr/sbin/dhcp dev ethx (ethx belong to eth to define dhcp)

7) Configure the DHCP server (on your servers LAN interface)I think this is an introduction to the below points

7.1 Set a private IP-address of the servers LAN interface
(e.g. 192.168.0.100)
This could be defined like this auto eth1
iface eth1 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.100


7.2 Set a subnet mask (e.g. 255.255.255.0) Couldn't this be done in the above point ? if not where I could define it ?

7.3 Definde a scope of private IP-address to your servers DHCP-server
(e.g. 192.168.0.10-192.168.0.99).This could be probably defined on the dhcp (/etc/dhcp.conf) and must start with range 192.168.0.10 192.168.0.99

7.4 Set a default gateway to the LAN interfaces IP-address
(e.g. 192.168.0.100)This probably would be the same has the above point, if not, where it can be defined.

Thanks for your patient and once again thanks a lot
 
  


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
Cable Modem and RH AS 2.1 pjoran Linux - Networking 3 06-07-2005 02:57 PM
cable modem help mifan Linux - Newbie 3 02-16-2005 04:25 PM
printer cable > modem cable? C++freak Linux - Hardware 1 06-21-2003 01:53 PM
cable modem Rnastyracer Linux - Newbie 7 12-26-2002 11:06 AM
Cable Modem Painmaster Linux - Newbie 2 03-18-2002 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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