Posted by: isaraffee | August 10, 2009

Connecting Vector Linux to the Internet

Connecting Vector Linux to the Internet

Plug in the Ethernet cable of the Vector Linux to the router mine is a Huawei E960 wired/ wireless router).

You then need to use VASM to configure the eth0 to use dhcp instead of static IP address. Alternatively, you can also type vnetconf on the command line.

After you have done the appropriate settings (i.e. set it to use DHCP), you will see that a new IP address has been assigned, as shown by the command below:

root:# ifconfig

eth0 Link encap:Ethernet HWaddr 00:E0:7D:A1:06:D7

inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3 errors:0 dropped:0 overruns:0 frame:0

TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:1240 (1.2 KiB) TX bytes:1830 (1.7 KiB)

Interrupt:11 Base address:0xec00

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:4898 errors:0 dropped:0 overruns:0 frame:0

TX packets:4898 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:245164 (239.4 KiB) TX bytes:245164 (239.4 KiB)

NOTE:

To restart the network services in Vector Linux, you can either use via the command line using command vinet or simply save and exit your VASM.

Another way to restart the network services is by the network script as show below:

root:# cd /etc/rc.d

root:# ./rc.inet1

Usage: ./rc.inet1 {start|stop|restart|reload|status}

So you need to supply argument for this script e.g to stop, start or reload the network services.

Now try to surf any website, and to do so lauch any web browser of your choice, and in my case it’s SeaMonkey. Yes, you would be able to browse the Internet.

Now let’s see the configuration file /etc/rc.d/rc.inet1

root:# more rc.inet1

#!/bin/sh

# This file is supposed to be created by vnetadd

# and modified by vnetset.

# You can modify it by hand, but be careful 😉

#

# GNU GPL (c) Eko M. Budi, 2004

# (c) Vector Linux, 2004

#

###########################################################

## The settings

DEVICE=’eth0′

DHCP=’yes’

IPADDR=’127.0.0.1′

NETMASK=’255.255.0.0′

GATEWAY=’172.18.0.1′

PROBE=’no’

###########################################################

## The script

## You may make customized script here

## If not, source the standard network

. /etc/rc.d/functions-network “$@”

From the above output, the gateway setting should not be set to 172.18.0.1 but should be set to 192.168.1.1,i.e. the IP address of the router. I will fix this later.

We can also view our routing table by typing:

root:# netstat -rn

Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

In this routing table, the gateway is set to the correct IP address.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: