الجمعة، 28 مايو 2010

Linux Networking Setting up a direct DSL connection

Setting up a direct DSL connection

- Do you have a fixed static IP address ?


If you are using a DSL connection with fixed or static IP addresses, then the configuration steps are the same as those outlined earlier. You plug your Ethernet interface into the DSL modem, configure it with the IP address, subnet mask, broadcast address, and gateway information provided by your ISP and you should have connectivity when you restart your interface. Remember that you might also need to configure your DNS server correctly.

- Are you using a DSL connection with a DHCP or dynamic IP address assignment ?


In ths case, your ISP will provide you with a PPP authentication over Ethernet (PPPoE) username and password which will allow your computer to login transparently to the Internet each time it boots up. Fedora Linux installs the rp-pppoe RPM software package required to support this. You can download the package at the following URL.

http://rpm.pbone.net/index.php3/stat/4/idpl/1953277/com/

If you have any trouble installing the package, try googling to find a new package. The above package has worked for me.

After installing the RPM, you need to go through a number of steps to complete the connection. The PPPOE configuration will create a software-based virtual interface named ppp0 that will use the physical Internet interface eth0 for connectivity. Here's what you need to do:


  • Make a backup copy of your ifcfg-eth0 file.

-------------
root@Basil15099/~#
root@ Basil15099/~# cd /etc/sysconfig/network-scripts/
root@Basil15099/~# ls ifcfg-eth0
ifcfg-eth0
root@Basil15099/~# cp ifcfg-eth0 DISABLED.ifcfg-eth0
-------------

  • Edit your ifcfg-eth0 file to have no IP information and also to be deactivated on boot time.

-------------
DEVICE=eth0
ONBOOT=no
-------------

  • Shutdown your eth0 interface.


-------------
[root@Basil15099/~# ifdown eth0
[root@Basil15099/~#
-------------


So, we have taken all precautions and shall go ahead setting up DHCP connection.


In linux, the command adsl-setup will help you to configure the DHCP connection. If the command does not exists, please check in /sbin directory as well.


  • Run the adsl-setup configuration script

-------------
[root@Basil15099/~# adsl-setup
-------------


It will prompt you for your ISP username, the interface to be used (eth0) and whether you want to the connection to stay up indefinitely. We'll use defaults wherever possible.

-------------
Welcome to the ADSL client setup.� First, I will run some checks on

your system to make sure the PPPoE client is installed properly...

LOGIN NAME

Enter your Login Name (default root): basil-login@isp

INTERFACE

Enter the Ethernet interface connected to the ADSL modem For Solaris, this is likely to be something like /dev/hme0. For Linux, it will be ethX, where 'X' is a number.
(default eth0):

Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds after which the link should be dropped.� If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP addresses. You might have some problems with demand-activated links.

Enter the demand value (default no):
-------------

It will then prompt you for your DNS server information. This step edits your /etc/resolv.conf file. If you're running BIND on your server in a caching DNS mode then you might want to leave this option blank. If you want your ISP to provide the IP address of its DNS server automatically then enter the word server.

-------------
DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic DNS addresses', enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are doing and not modify your DNS setup.
Enter the DNS information here:
-------------

The script will then prompt you for your ISP password

-------------
PASSWORD

Please enter your Password:
Please re-enter your Password:
-------------

Then it will ask whether you want regular users (not superuser root) to be able to activate/deactivate the new ppp0 interface. This may be required if non-root members of your family or home office need to get access to the Internet:

-------------
USERCTRL

Please enter 'yes' (two letters, lower-case.) if you want to allow normal user to start or stop DSL connection (default yes):
-------------

The rp-pppoe package has two sample iptables firewall scripts located in the /etc/ppp directory named firewall-standalone and firewall-masq. They are very basic and don't cover rules to make your Linux box a web server, DNS server, or mail server. I'd recommend selecting none if you are not sure about the firewall rules.

-------------
FIREWALLING

Please choose the firewall rules to use. Note that these rules are very basic. You are strongly encouraged to use a more sophisticated firewall setup; however, these will provide basic security.
If you are running any servers on your machine, you must choose 'NONE' and set up firewalling yourself. Otherwise, the firewall rules will deny access to all standard servers like Web, e-mail,
ftp, etc. If you are using SSH, the rules will block outgoing SSH connections which allocate a privileged source port.

The firewall choices are:

0 - NONE: This script will not set any firewall rules. You are responsible for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway for a LAN

Choose a type of firewall (0-2): 0
-------------


You'll then be asked whether you want the connection to be activated upon booting. Most people would say yes. I too.

-------------
Start this connection at boot time

Do you want to start this connection at boot time?
Please enter no or yes (default no):yes
-------------

Just before exiting, you'll get a summary of the parameters you entered and the relevant configuration files will be updated to reflect your choices when you accept them:

-------------
** Summary of what you entered **


Ethernet Interface: eth0

User name: bigboy-login@isp
Activate-on-demand: No
DNS: Do not adjust
Firewalling: NONE
User Control: yes
Accept these settings and adjust configuration files (y/n)? y

Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
(But first backing it up to /etc/ppp/chap-secrets.bak)
(But first backing it up to /etc/ppp/pap-secrets.bak)
-------------

At the very end it will tell you the commands to use to activate /deactivate your new ppp0 interface and to get a status of the interface's condition.

-------------
Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0' to see the link status.
-------------



After you have completed installing rp-pppoe you should be able to access the Internet over your DHCP DSL connection as expected.



Some Important Files Created By adsl-setup



The adsl-setup script creates three files that will be of interest to you. The first is the ifcfg-ppp0 file with interface's link layer connection parameters

-------------
[root@Basil15099/~# less ifcfg-ppp0
USERCTL=yes
BOOTPROTO=dialup
NAME=DSLppp0
DEVICE=ppp0
TYPE=xDSL
ONBOOT=yes
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=20
LCP_FAILURE=3
LCP_INTERVAL=80
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
DEFROUTE=yes
SYNCHRONOUS=no
ETH=eth0
PROVIDER=DSLppp0
USER= bigboy-login@isp
PEERDNS=no
[root@Basil15099/~#
-------------

The others are the duplicate /etc/ppp/pap-secrets and /etc/ppp/chap-secrets files with the username and password needed to login to your ISP:

-------------
[root@Basil15099/~# less /etc/ppp/pap-secrets
# Secrets for authentication using PAP
# client server secret IP addresses
"basil-login@isp" * "password"
[root@Basil15099/~#
-------------

That's All :-)


That's All :-)

ليست هناك تعليقات:

إرسال تعليق