LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
LinkBack Search this Thread
Old 06-23-2006, 12:19 PM   #1
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, Ubuntu, OpenBSD
Posts: 1,004

Rep: Reputation: 36
Need aid with static IP


Hi,

Just got a broadband access to my house. Only problem is that it uses static IP from which I don't have any experience.

So I need aid getting my linux laptop to connect into the internet.

I have the following info:

IP
Subnet
Gateway
Pri DNS
sec DNS


The line works as I am typing this from my friends laptop(WinXP).

I have tried this with route and ifconfig commands but no luck so far as I don't know the correct syntax and such. Been reading through the man pages but still no luck.

So give the proper command to connect the laptop to internet. I'm using Gentoo.

I put the DNS things to resolv.conf. Was it done correctly?
 
Old 06-23-2006, 12:23 PM   #2
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 478

Rep: Reputation: 30
whats the ip address and gateway you are going to use? If for slackware I know you edit /etc/rc.d/rc.inet1.conf and put in the proper ip address and netmask and then at the bottem you put in the gateway. in /etc/resolve you put in the dns and reboot
 
Old 06-23-2006, 12:30 PM   #3
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
Are you using a USB modem? If so, I would suggest looking up a guide on how to set up your model of modem with Linux. The fact that it's a static IP shouldn't make any difference, as it should be assigned by your ISP's server when you connect to them. I didn't have to make any changes when switching from dynamic to static IP at home, but I am using a separate ethernet modem/router, not a USB or internal one.
 
Old 06-23-2006, 12:40 PM   #4
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, Ubuntu, OpenBSD
Posts: 1,004

Original Poster
Rep: Reputation: 36
Gentoo doesn't have the /etc/rc.d/ folder but has /etc/init.d/ folder with similar files. Only it's syntax is way more cryptic than slacks and doesn't seem to offer same solutions.

I need the command to tell the connection to route the packets through the gateway. I can issue "ifconfig eth0 xxx.xxx.xxx.xxx" to get a static ip but that doesn't work. This should be able to be done without a reboot.

The signal is coming through ethernet so I don't have to work with USB-modem (been there and gotten a new modem).

I got close with the route command. Something like following:
"route add net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx dev eth0" but when I issue plain "route" and check the routing tables it tells it's not using any gateway and IP is wrong.

Last edited by Zmyrgel; 06-23-2006 at 12:42 PM.
 
Old 06-23-2006, 12:46 PM   #5
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
Most likely, your modem gets the external IP assigned by your ISP. Your computer will only get an internal network IP. Assuming your modem is set up as a dhcp server, all you should need to do is set your computer to get its IP from dhcp. Can't remember how to do this in Gentoo, it was a while ago I set my box up. You might need to add the nameservers in /etc/resolv.conf but that's all. If you need to set the gateway for accessing the net, it should be the internal network address of your modem, not the external address assigned by your ISP.
 
Old 06-23-2006, 01:05 PM   #6
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, Ubuntu, OpenBSD
Posts: 1,004

Original Poster
Rep: Reputation: 36
The instructions which I have state that I have to set static IP and DNS servers with gateway in windows so I think it applies to the linux as well.

The set is that I have wireless broadband, meaning that I have receiver installed on the roof and cable coming down to my room where it connects to a box which looks like extension cord box. Then from there to my computer runs a ethernet cable.

I just asked this same thing on IRC and have configured /etc/conf.d/net to those guidelines but I'd still like to know how this is done manually.
 
Old 06-23-2006, 01:48 PM   #7
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 478

Rep: Reputation: 30
I said for slackware do that. I dunno about gentoo
 
Old 06-23-2006, 02:07 PM   #8
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, Ubuntu, OpenBSD
Posts: 1,004

Original Poster
Rep: Reputation: 36
Okay, My /etc/conf.d/net file looks like this at the moment:

Code:
config_eth0=( "xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx" )
routes_eth0=( "default via xxx.xxx.xxx.xxx" )
dns_servers_ESSID=( "xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx" )
But still no connection.
 
Old 06-24-2006, 01:14 PM   #9
phillinux1
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by Zmyrgel
Gentoo doesn't have the /etc/rc.d/ folder but has /etc/init.d/ folder with similar files. Only it's syntax is way more cryptic than slacks and doesn't seem to offer same solutions.

I need the command to tell the connection to route the packets through the gateway. I can issue "ifconfig eth0 xxx.xxx.xxx.xxx" to get a static ip but that doesn't work. This should be able to be done without a reboot.

The signal is coming through ethernet so I don't have to work with USB-modem (been there and gotten a new modem).

I got close with the route command. Something like following:
"route add net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx dev eth0" but when I issue plain "route" and check the routing tables it tells it's not using any gateway and IP is wrong.
make sure your subnet mask is correct, when you issue a ifconfig eth0 x.x.x.x netmask x.x.x.x
Also, It might help to put your server's ip in the hosts file. In the route command are you are putting the correct network number which most likely will have a 0 in the last octet.

I'm no expert, I'm trying to put together a small network in my school. I hope this helps.
 
Old 06-25-2006, 06:59 AM   #10
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, Ubuntu, OpenBSD
Posts: 1,004

Original Poster
Rep: Reputation: 36
Yep, I got it to work. There was no zero as a last digit in the gateway btw

I just issued the following:
Code:
ifconfig eth0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
route add default gw xxx.xxx.xxx.xxx
Thanks for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aid me recover from reboot. Zmyrgel Slackware 1 05-11-2006 03:01 AM
rpm --aid problem hemings Suse/Novell 1 10-28-2004 05:37 PM
Xandros internet aid Gavin19 Linux - Newbie 0 09-23-2004 03:54 PM
Linux Webserver Aid. HaTHor Linux - Networking 2 10-23-2003 01:56 PM
Looking for software to aid in writing my own o/s ChimpFace9000 Linux - Software 4 09-11-2002 06:16 PM


All times are GMT -5. The time now is 08:49 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration