Thursday, August 7, 2008

SETTING NETWORK ON LINUX (DSL / LAN )

This is a MINI HOW-TO on setting up the network configurations to connect yout Linux box on to a DSL network. It also applies to setting up your machine on a LAN.

The configuration instructionsa are specific to Redhat Linux distro. There might be slight difference in the configuration files with other distros.


Get the IP Addresses

All you need from your DSL provider or your LAN sys-admin is the following set of IP addreses.

1. Your IP address

111.111.111.111

2. The Gateway IP address

222.222.222.222

3. The netmask

255.255.255.333

4. The DNS ( Primary and Secondary )

444.444.444.444
555.555.555.555

NOTE: The IP addresses above are just place holders please replace with your actual IP addresses.


1.Set up your IP ( 111.111.111.111 )

* add the following line to /etc/hosts
111.111.111 hostname

* Eg: If your machine was called kahlua:

$cat /etc/hosts
127.0.0.1 localhost localhost.localdomain
111.111.111.111 kahlua


2.Set up Gateway ( 222.222.222.222 )


* Edit the /etc/sysconfig/network file with:
GATEWAY="222.222.222.222"

* Eg: If your machine was called kahlua:

$cat /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4="yes"
HOSTNAME="kahlua"
GATEWAY="222.222.222.222"
GATEWAYDEV="eth0"

3. Set up the netmask ( 255.255.255.333 ) and IP ( 111.111.111.111 )

* Edit /etc/sysconfig/network-scripts/ifcfg-eth0 with:
IPADDR="111.111.111.111"
NETMASK="255.255.255.333"

* Eg: If your machine has IP 111.111.111.111 :

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
IPADDR="111.111.111.111"
NETMASK="255.255.255.333"
ONBOOT="yes"
BOOTPROTO="none"
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"

4. Set up the DNS ( 444.444.444.444 and 555.555.555 )

* Edit /etc/resolv.conf and add:
nameserver 444.444.444.444
nameserver 555.555.555.555

* Eg: If your machine was called kahlua
and your providers domain is called dslinc.net :

$ cat /etc/resolv.conf
domain dslinc.net
search kahlua
nameserver 444.444.444.444
nameserver 555.555.555.555


Now you should be all set. Just ping any server on the net and verify if everything works fine.


Fore more information, please read the how-to docs NET-3-HOWTO / NET3-4-HOWTO in your /usr/doc/HOWTO ( normal path for Redhat distros ). Or search the newsgroup postings or linux archives.

0 komentar:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Sweet Tomatoes Printable Coupons