LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2004, 09:33 AM   #1
trackrat
Member
 
Registered: Feb 2004
Location: Birmingham UK
Posts: 148

Rep: Reputation: 15
Set up internet connection


I have 2 computers my main one is XP the other one is a duel boot XP & mandrake 9.2.
I have both computers sharing the BB through a router, however being new to linux I have no idea how to access the internet on linux.
I have tried, but cannot find a way to set it up.
Can anyone supply me with a set of simple instructions.
Regards Alan.
 
Old 03-14-2004, 11:51 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
If I've correctly understood your network architecture, the setup is very simple:
ifconfig eth0 inet your_linux_private_IP up
route add default gw your_router_IP dev eth0
And everything should go fine

Oliv'
 
Old 03-14-2004, 05:28 PM   #3
trackrat
Member
 
Registered: Feb 2004
Location: Birmingham UK
Posts: 148

Original Poster
Rep: Reputation: 15
????

I take it this is a command that has to be run.
Is it one continuous command and how do I open the command prompt box.
 
Old 03-15-2004, 12:17 PM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
OK, you have two solutions: either you browse startup menu and try to find a program named Konsole, xterm, kterm, gterm or something lik that or you switch from graphical mode to text mode by typing: <Ctrl>+<Alt>+<F1> and log as root (return to graphical mode with: <Ctrl>+<Alt>+<F7>)
if you've choosed first solution, type
Code:
counter@CS-Debian:~$ whoami
counter
counter@CS-Debian:~$ su
Password:
CS-Debian:/home/counter# whoami
root
I explain: whoami is to know who you are... the ifconfig and route command requires root (super user) privileges. So if you are not root, type su to log as root and enter root password. Then retry whoami to see if you are root
then you can type:
Code:
ifconfig eth0 inet 192.168.0.25 netmask 255.255.255.0 up
to setup your IP address to 192.168.0.25 with a netmask of 255.255.255.0
and then:
Code:
route add default gw 192.168.0.1  dev eth0
to tell your system that the gateway is 192.168.0.1 and eth0 is the NIC to access it

Oliv'
 
Old 03-16-2004, 01:27 PM   #5
trackrat
Member
 
Registered: Feb 2004
Location: Birmingham UK
Posts: 148

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Oliv'
OK, you have two solutions: either you browse startup menu and try to find a program named Konsole, xterm, kterm, gterm or something lik that or you switch from graphical mode to text mode by typing: <Ctrl>+<Alt>+<F1> and log as root (return to graphical mode with: <Ctrl>+<Alt>+<F7>)
if you've choosed first solution, type
Code:
counter@CS-Debian:~$ whoami
counter
counter@CS-Debian:~$ su
Password:
CS-Debian:/home/counter# whoami
root
I explain: whoami is to know who you are... the ifconfig and route command requires root (super user) privileges. So if you are not root, type su to log as root and enter root password. Then retry whoami to see if you are root
then you can type:
Code:
ifconfig eth0 inet 192.168.0.25 netmask 255.255.255.0 up
to setup your IP address to 192.168.0.25 with a netmask of 255.255.255.0
and then:
Code:
route add default gw 192.168.0.1  dev eth0
to tell your system that the gateway is 192.168.0.1 and eth0 is the NIC to access it

Oliv'
I tried this after logging in as root from the Konsole and text and all I keep getting is bash unknown or bad command, so now I am more confused than ever
 
Old 03-17-2004, 06:32 AM   #6
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Ok, the problem is that your PATH variable is not correctly set up for root user. type this (always as root):
Code:
root@Olinux-lfs:~# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
the PATH variable contains the path where to find your executables. ifconfig and route program are in /sbin directory. So if /sbin is not in the output of "echo $PATH" either you add it (temporaly):
Code:
export PATH=$PATH:/sbin
Then you can retry ifconfig and route commands
or you type the command with his full path:
Code:
/sbin/ifconfig eth0 inet 192.168.0.25 netmask 255.255.255.0 up
/sbin/route add default gw 192.168.0.1  dev eth0
I hope this time that'll work
 
Old 03-17-2004, 12:23 PM   #7
trackrat
Member
 
Registered: Feb 2004
Location: Birmingham UK
Posts: 148

Original Poster
Rep: Reputation: 15
No Go

Quote:
Originally posted by Oliv'
Ok, the problem is that your PATH variable is not correctly set up for root user. type this (always as root):
Code:
root@Olinux-lfs:~# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
the PATH variable contains the path where to find your executables. ifconfig and route program are in /sbin directory. So if /sbin is not in the output of "echo $PATH" either you add it (temporaly):
Code:
export PATH=$PATH:/sbin
Then you can retry ifconfig and route commands
or you type the command with his full path:
Code:
/sbin/ifconfig eth0 inet 192.168.0.25 netmask 255.255.255.0 up
/sbin/route add default gw 192.168.0.1  dev eth0
I hope this time that'll work
I have tried your latest suggestion but when I type in root@olinux-lfs:~# echo $PATH it is comong up as a bad command root@olinux-lfs:~#
Would it be better to reinstall Mandrake 9.2 and configure the internet in the setup?

Last edited by trackrat; 03-17-2004 at 12:26 PM.
 
Old 03-17-2004, 01:12 PM   #8
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Sorry I made you make a mistake
In fact you just have to type echo $PATH ... You made a mistake cause I did a copy/paste from my shell, and I've included my bash prompt.
But the most important part is:
Code:
/sbin/ifconfig eth0 inet 192.168.0.25 netmask 255.255.255.0 up
/sbin/route add default gw 192.168.0.1  dev eth0
 
Old 03-17-2004, 02:10 PM   #9
trackrat
Member
 
Registered: Feb 2004
Location: Birmingham UK
Posts: 148

Original Poster
Rep: Reputation: 15
echo$PATH

Tried the echo $PATH and this is the reply.
- bash: echo/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/home/alan/bin: no such file or directory.
Does this help
A friend told me I was not using root and to type in the console su and then my password but this did not work either






Last edited by trackrat; 03-17-2004 at 02:26 PM.
 
Old 03-17-2004, 03:05 PM   #10
skel
Member
 
Registered: Jan 2004
Distribution: Slackware 10 ; Gentoo ; OpenBSD 3.6
Posts: 101

Rep: Reputation: 15
you may find it easier to set up the appropriate scripts. I use redhat so this may not apply to you.

Check if there are files in:
/etc/sysconfig/network-scripts/

type this to check:
ls /etc/sysconfig/network-scripts

if you see something along the lines of 'No such file or directory' then this does not apply to you, otherwise continue

create/edit the file:
/etc/sysconfig/network-scripts/ifcfg-eth0

to look like:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

then restart your computer
 
Old 03-17-2004, 04:55 PM   #11
trackrat
Member
 
Registered: Feb 2004
Location: Birmingham UK
Posts: 148

Original Poster
Rep: Reputation: 15
thanks

I got no such file or directory, thanks for your help and time .
How can I check I am in root as at the command I get [alan@local host alan] $. Is this root?
 
Old 03-18-2004, 07:27 AM   #12
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
To check if you are root, type whoami. Another quick way to check if you are root or not is to see wether your prompt line ends with a # or not.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set up my internet connection master Linux - Networking 1 07-31-2005 07:13 AM
How do you set up an internet connection in fluxbox? Audrey Linux - Newbie 1 04-10-2005 11:01 AM
How Do I Set Up An Internet Connection? jlacroix Linux - Hardware 10 11-21-2004 11:57 AM
How to set up Internet connection natram Linux - Networking 6 01-07-2004 01:59 PM
How to set-up internet connection? Byte3 Linux - Newbie 2 10-19-2003 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration