Configuring the Net
Translated by J.B.Esteves - BR
20/11/06

 





Nowadays the most of Linux distributions brings some kind of assistant to configure the net, as much for Internet connection as for inside net connection.

On Dreamlinux there are two scripts that help on the configuration of the main existent connection ways.

However it can be necessary some handy intervention on the configuration file, in the case the system isn't connecting rightly.


Below, I'll relate how to solve some of these problems that certainly will cover the most difficulties found.

 

To make the connection with the Internet you have the following options:

1- Connect using a ADSL/PPPOE modem with authentication.

2- Connect using a variable IP ( DHCP )

3- Connect using an Static IP defined by your provider

For the three conditions above, the configurations stay in an unique file, the interfaces file can be found on the folder network
inside of /etc.

 



Connect using ADSL/PPPOE:

If you have an external ADSL modem and an account in an Internet provider that requires password to connect use the
menu option Configure ADSL/PPPOE.

The screens are self-explicatives and you just have to keep pressing ok, ok, ok, fulfilling the spaces where the assistant
asks the user's name and the password.





To know how the interfaces file came out, open it with the texts editor ( mousepad, on Dreamlinux )

The interfaces file content must be like this:


# Loopback
auto lo
iface lo inet loopback

auto dsl-provider
iface dsl-provider inet ppp
provider dsl-provider


pre-up /sbin/ifconfig eth0 up
pre-up /sbin/ifconfig eth1 up


This configuration supposes that you have already used the Configure assistant ADSL/PPPOE so therefor it has already the username and password configurated.

In the case on system reboot the connection doesn't re-stabilish automatically, try use the command, on the terminal:

sudo /etc/init.d/networking restart

That will restart the web, consulting the interfaces file again.

On the assistant "Configure ADSL/PPPOE" there's even the option to create an icon on Desktop that, when clicked, will execute the same command described above:



Connect using DHCP ( variable IP )

This is the most simple method of configuration because here all is automatic. However it's needed to know if your machine is part of a net where the ip (web address) is furnished by some external way as a micro that is sharing the connection, or if your micro is connected on an external net as the net used on condominiums, for example.

If you connect to an internal net to access the Internet, the net manager will know to tell you if your IP is variable or not.

Usually the Internet provider warns the user if his configuration has variable IP.

To configure that kind of connection use the Configure-Net on menu. Choose configure on the configuration box that follows. Click on apply and, when the bottom is free, click on exit.

In that case the /etc/network/interfaces file content must be like this:

 

# Loopback
auto lo
iface lo inet loopback


auto eth0
iface eth0 inet dhcp

 

This configuration supposes that the net cable that brings the external net signal is connected to the card eth0 ( the first card ). If you have more than one net card in your micro so it's possible that the net is connected to the second card. In that case replace the expression eth0 to eth1.

 

Connect using STATIC IP

In local nets, most in enterprises, it's common find this kind of connection, where each machine connected to net has and address ( IP) static. A lot of Internet connections in shared nets, too.

In condominiums, they can use this kind of connection.

The provider or net manager can tell you if your machine will have a static or a variable IP.
To configure this kind of connection use the menu Configure-Net and on the dialogue box that follows you must enter with the numbers furnished by your provider or manager:



In this case the /etc/network/interfaces file content must be like this:

 

# Loopback
auto lo
iface lo inet loopback


#auto eth0
iface eth0 inet static
address 192.168.0.123
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1


This configuration supposes that the net cable that brings the external net signal is connected to the card eth0 ( the first card ). If you have more than one net card in your micro so it's possible that the net is connected to the second card. In this case replace the expression eth0 to eth1.

NOTE: The numbers on the forms ADRESS here are just an example. Obviously if your IP is static you must change these numbers for the numbers furnished by your provider or manager.

DNS Domain Name Server

You must have observed on the configuration box above that the forms on the part below (DNS) are filled. These numbers are furnished by the provider or net manager too. If your IP is static, necessarily you provider should give you these numbers and you must fill these forms. Note that the first number is the primary DNS and the following number is the secondary DNS.

IMPORTANT: In any case cited above, if you got connection and after, if on reboot the system doesn't re-connect, use the command:

sudo /etc/init.d/networking restart


There are a lot of other possible configurations for the interfaces file. Who has two cards, for example, will have to has another configuration.

If you use a wireless card will have to modify too, in the certain form, this file.

But, just use the handy way if the assistants doesn't work for you.


<< BACK to Tutorials page