LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-04-2005, 10:22 PM   #1
dnvikram
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Rep: Reputation: 0
URGENT!!Cannot Connect Linux To Internet


Hi Folks!

I have a Acer 2410 Laptop which is dualboot with Windows Xp and Red Hat Linux9 with Broadband connection at home.I am able to connect to the internet from the Windows XP OS fine.But,not from the RH Linux.I tried the internet connection wizard,netconfig,used the ifconfig command,edited the /etc/hosts,/etc/default-route,/etc/sysconfig/network,igcfg-eth0,resolv.conf file and what not.Below are my IP details in XP.

IP:172.20.xx.xx
Subnet:255.255.255.255
Gateway:10.10.xx.x
Nameserver:10.10.xx.x

What do I do to connect my linux to internet?I have tried everything...Plz note that Im not new to linux..Its just that this is the first time I configuring my laptop for internet...

I would really appreciate any help in this matter..

Hoping to hear from U soon...

Thanks.

DNV
 
Old 12-05-2005, 01:35 AM   #2
vavoem
Member
 
Registered: Oct 2003
Location: Rotterdam, the Netherlands
Distribution: Debian Sarge
Posts: 102

Rep: Reputation: 15
You seem to have your ip configuration wrong

You cannot connect to your gateway beacause it is in a different subnet

Your subnet mask allows NO ip adresses
 
Old 12-05-2005, 01:40 AM   #3
dnvikram
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
sorry for the typo-subnetmask is 255.255.255.0

Thanx for the reply..

subnet mask is 255.255.255.0..I mustve typed it wrong here in the post..I tried with the correct mask only..I checked what all files I knew..so,can u kindly suggest what I may be doing wrong?

Thanks.

DNV
 
Old 12-05-2005, 03:01 AM   #4
abakali
Member
 
Registered: Dec 2005
Location: karachi
Distribution: RedHat
Posts: 75

Rep: Reputation: 15
Quote:
Originally Posted by dnvikram
Thanx for the reply..

subnet mask is 255.255.255.0..I mustve typed it wrong here in the post..I tried with the correct mask only..I checked what all files I knew..so,can u kindly suggest what I may be doing wrong?

Thanks.

DNV
use this iptables script
his is a how-to about sharing the internet via a linux box to the rest of your internal network.

In windows this is know as ICS (Internet Connection Sharing).
In linux it is called NAT (Network Address Translation).

1. On the linux box (that is directly connected to the internet, and is supposed to do the internet sharing), start a terminal. Run the command su and then type the root password to become root.

2. Open the file /etc/rc.d/rc.local in your favorite text editor and add this on a new line at the bottom
/etc/rc.d/rc.ipmasq and save the file.

3. Then, create a new file called rc.ipmasq in the /etc/rc.d/ directory and open this file in a text editor and add these lines



#!/bin/sh

IPTABLES=/sbin/iptables

#All The lines below are NAT routing

# flush any old rules
$IPTABLES -F -t nat

# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o eth0 -j MASQUERADE

# enable IP forwarding (of incoming packets)
echo 1 > /proc/sys/net/ipv4/ip_forward



Save this file.

This script assumes that eth0 is the ethernet adaptor connected to the internet (say, thru a DSL/cable modem). Change it depending on your configuration (eth1, eth2 and so on). If the connection to the internet is not thru an ethernet device (as in the case of ordinary dialup or USB modem), you have to use ppp0 (or ppp1, ppp2 and so on).
The network connections to the internet and intranet should already be up (how to do that is outside the scope of this document).

4. Make this script file executable by running chmod 755 /etc/rc.d/rc.ipmasq

5. Then run the command /etc/rc.d/rc.ipmasq to enable the internet sharing.

6. Now you can stop being root by running exit

The above script will work after the following have been already done:

Set up the network on all the computers in the LAN. Make sure every computer can be reached from another computer by "ping".
On each client computer, set the gateway to the internal IP address of the linux computer that is connected directly to the internet. Under DNS put in the primary and/or secondary DNS IP addresses of your ISP (Internet Service Provider).
 
Old 12-05-2005, 04:49 AM   #5
vavoem
Member
 
Registered: Oct 2003
Location: Rotterdam, the Netherlands
Distribution: Debian Sarge
Posts: 102

Rep: Reputation: 15
Even if your subnet is 255.255.255.0

You cannot connect to your default gatway because it is in a different subnet.

255.255.255.0

Means your subnet is

172.16.1.x

Since your default gateway is something starting with 10.100.x.x it allready means you have to have some sort of path to that adress.

ie. a router with inside adres 172.16.1.x and external 10.100.x.x

You have a better chance changing your ip adres to something in the 10.100.x.x range and set your subnet mask to 255.255.0.0
 
  


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
how to connect to Internet with Linux ? MaaSTaaR Linux - General 13 08-11-2005 01:16 PM
New to linux, cannot connect to the internet. calathar Linux - Networking 30 04-27-2005 04:57 AM
How to connect to the internet- URGENT PLZ ! vwal_13 Slackware 9 04-11-2004 03:15 AM
can't connect to the internet:linux dont read my internet address droplsh Linux - General 1 02-29-2004 07:32 PM
I can't connect to the Internet in Linux scracker Linux - Networking 5 09-20-2003 04:50 PM

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

All times are GMT -5. The time now is 09:41 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