One of the first things you need in a linux environment is a good internet connection….
Mine is a Dataone connection from BSNL and modem supplied was Huawei SmartAX MT 880. SmartAX is actually a ADSL modem/router. It can be used either as a router or as a modem(in bridged mode). In the router mode the connection is ready as soon as you switch on it. But for the modem mode you will need to dial from your computer to establish the connection.
I decided to use the modem mode as I’ve two accounts and so its easier in the dialer to change the account. I’ve created shell scripts which dials the required account.
Well the basic steps for this setup are:
- Set up a network link between your computer and the modem
- Run adsl-setup and create a ppp0 connection.
- Once ready, start or stop the connection using the adsl-start and adsl-stop commands
I connected the modem to my ethernet card. The modem’s IP is 192.168.1.1 so I setup my NIC via Desktop > system settings > Network as
eth0
Static IP and not DHCP
IP 192.168.1.2
Subnet 255.255.255.0
Gateway 192.168.1.1
Before proceeding further, I did some routine checks:
ping 127.0.0.1 -if you get reply your systems networking is okay…
ping 192.168.1.2 -if you get reply your NIC is working
ping 192.168.1.1 -reply means that the connection to the adsl modem is ok
So if the above tests are successful you are ready to go…
Type ‘su -‘ (don’t forget the – ) and type the command adsl-setup
adsl-setup is really a shell script which guides you through the process of setting up a ppp0 connection. It asks you several questions and usually gives you a choice of answers.
Here, I’ve posted the steps involved and have scrapped-off some of the irrelevant details.
=====
Welcome to the ADSL client setup. First, I will run some checks on
your system to make sure the PPPoE client is properly installed…
LOGIN NAME
Enter your Login Name (default john): myusername
INTERFACE
Enter the Ethernet interface connected to the ADSL modem?
(default eth0): eth0
Do you want the link to come up on demand, or stay up continuously?
Enter the demand value (default no): no
DNS
Please enter the IP address of your ISP’s primary DNS server.
Enter the DNS information here: server ## server means that DNS will be obtained from ISP
PASSWORD
Please enter your Password:
Please re-enter your Password:
USERCTRL
Please enter ‘yes’ (three letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes): yes
FIREWALLING
Please choose the firewall rules to use.
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 ## I had a firewall script ready and wanted to use it
Start this connection at boot time
Do you want to start this connection at boot time?
Please enter no or yes (default no):no
** Summary of what you entered **
Ethernet Interface: eth0
User name: myusername
Activate-on-demand: No
DNS addresses: Supplied by ISP’s server
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)
Congratulations, it should all be 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.
=======
Here you are, now type ‘adsl-start‘ and try
ping 64.233.167.99 # this is the ip of google.com, if you get reply then connection is okay
ping www.google.com # if you don’t get this right then you will have to manually enter your DNS information.