LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cable modem (https://www.linuxquestions.org/questions/linux-newbie-8/cable-modem-610912/)

LMSSML 01-03-2008 02:56 PM

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.

LMSSML 01-04-2008 05:55 AM

Help
 
Hi people,

Is there anyone who could help ?

H_TeXMeX_H 01-04-2008 08:43 AM

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 ?

LMSSML 01-04-2008 09:31 AM

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

btmiller 01-04-2008 12:57 PM

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.

LMSSML 01-04-2008 04:59 PM

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

Emerson 01-04-2008 05:47 PM

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.

exvor 01-04-2008 06:20 PM

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

uffe2 01-04-2008 07:28 PM

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 ?

jschiwal 01-04-2008 07:36 PM

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.

uffe2 01-04-2008 07:44 PM

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 (Post 3011776)
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.


jschiwal 01-04-2008 10:22 PM

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.

LMSSML 01-05-2008 07:57 AM

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.

uffe2 01-05-2008 10:38 AM

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)

LMSSML 01-05-2008 12:00 PM

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


All times are GMT -5. The time now is 08:40 PM.