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 - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-23-2006, 08:34 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Rep: Reputation: 30
Trying to make IP static


I'm using netconfig, and trying to make my IP static. I think I've got everything right, except I can't get my name server working. I use my ISPs DNS IPs right?
 
Old 01-23-2006, 08:59 PM   #2
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
depending on what ISP you use, you may be unable to get a static IP addresss. If it's an internal(that is, on your own network), then you won't have a problem. If you really want an external static IP, check with your ISP, and see if there's a way for them to set one up for you.
 
Old 01-23-2006, 09:11 PM   #3
carl0ski
Member
 
Registered: Sep 2004
Location: Melbourne, Victoria Australia
Distribution: Support those that support you :)
Posts: 872
Blog Entries: 12

Rep: Reputation: 30
Quote:
Originally Posted by Zeno McDohl
I'm using netconfig, and trying to make my IP static. I think I've got everything right, except I can't get my name server working. I use my ISPs DNS IPs right?
if you have a Router
that is your DNS server.
gateway is the same number.


If you dont use a router I hope you have a static IP from you ISP.
then yes you use the ISP's DNS servers address.


/etc/resolv.conf has/should your network settings

mines my router address
[root@localhost carl0ski]# cat /etc/resolv.conf
nameserver 10.0.0.2
# ppp temp entry
 
Old 01-23-2006, 10:55 PM   #4
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
Wait, so if I have a router I use the gateway IP?
 
Old 01-23-2006, 11:18 PM   #5
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
if you have a router, you have an internal network. This will allow you to have a static ip address, but maybe not on the outside. If you have a router, you will point your nameserver to the internal ip of the router, and the router in turn will set up it's own nameservers. Why do you want a static ip?
 
Old 01-23-2006, 11:19 PM   #6
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
I want an internal static IP, because my router firewall needs to unblock ports, but if the IP keeps changing, I have to keep changing the unblocked IP.
 
Old 01-23-2006, 11:33 PM   #7
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
your router firewall shouldn't be affecting internal ip addresses. Could you provide some more information please? Is it a wireless router?
 
Old 01-23-2006, 11:40 PM   #8
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
I didn't say the firewall was. The firewall is blocking ports that need to be open, such as 80. Or else people can't access the webserver.

The IP keeps changing as I stated, because I have not yet made it static.
 
Old 01-24-2006, 02:15 AM   #9
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
There is a more easy way to see if your address is internal or external (ie open to whole internet).
Does the address start with 192.168? Then it must be an internal address. Since the address keeps changing, then you're using DHCP (dynamic host control protocol). You need either DHCP for dynamic IPs or just a static IP.

Having a static external IP can be very costly. Most ISPs have only a limited set of IP addresses at their disposal and have to pay big amounts of money to get them. If you want one of them, reserved just for you, then that's going to cost you. Simple as that.
However, you probably don't need it.

Furthermore, if your address is internal, it's most likely that your router is handling the DHCP (think of it as the "handing out of the IP addresses"). If the router also has a built-in firewall, then it will adapt it's config for the changing IP addresses automatically. If the router and firewall are 2 separate devices, that's a different story.

I think, what you're looking for, is NAT support. NAT, or Network Address Translation, is often built into routers/firewalls and allows the firewall/router to make multiple computers externally visible with just 1 IP address (it translates this one, external IP address to the right internal IP address for each call using a simple lookup table). With NAT, but no DHCP, you would have static internal IPs.
 
Old 01-24-2006, 05:15 PM   #10
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
Yes, it's the internal IP I want static. I already stated it. Everything works fine except that I cannot resolve hostnames as I said already.

I assume I'm entering the wrong IP for the nameserver. I've tried my routers IP as well as a DNS IPS from my ISP and neither work. If I use the router IP, it instantly responds with "unknown host" while with the DNS IP, it takes a while.
 
Old 01-24-2006, 05:36 PM   #11
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
ok, so this is slackware? It should be something like

lo="lo 127.0.0.1"
eth0="eth0 192.168.1.xxx netmask 255.255.255.0 broadcast eth0 192.168.255"
INTERFACES=(lo eth0)
gateway="default gw 192.168.1.X"
ROUTES=(gateway)

That will set your IP to 192.168.1.xxx and your routers ip is 192.168.1.X
 
Old 01-24-2006, 05:39 PM   #12
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
I assume I have to put that in a file? I've been using netconfig... Why can't I use netconfig?
 
Old 01-24-2006, 05:52 PM   #13
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
use netconfig then.


netconfig [OPTION...]
--bootproto=(dhcp|bootp|none) Boot protocol to use
--gateway=STRING Network gateway
--ip=STRING IP address
--nameserver=STRING Nameserver
--netmask=STRING Netmask
--hostname=STRING Hostname
--domain=STRING Domain name
-d, --device=STRING Network device
--nodns No DNS lookups

Help options:
-?, --help Show this help message
--usage Display brief usage message


Regardless
your gateway will be your routers ip
your ip will be an open IP from your router. do ifconfig and look at the settings. then use them to set yourself up i guess. It's much easier and faster to edit resolv.conf though
 
Old 01-24-2006, 05:59 PM   #14
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
I know I'm using a valid IP. The gateway is my routers IP? I http to 192.168.100.1 to access my router setup, is that the routers IP? If so I've tried it. I still get "unknown host".
 
Old 01-24-2006, 06:09 PM   #15
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
what kind of router is it? Yes the gateway is the routers ip. Use dhcp, look at the settings of ifconfig then use those to set up you configuration with netconfig. Pay close attention to nameserver. I'll bet that is where you are having probs.

it should be something like
nameserver x.x.x.x <- could be more x's like xx.xx.xx.xx this is from your isp.
 
  


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
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
Error in make bash with static-link Kdr Kane Programming 7 02-25-2006 12:53 AM
Binutils Pass 1 error make LDFLAGS="-all-static" Phyrexicaid Linux From Scratch 5 08-25-2005 10:43 AM
make: *** [insmod.static] Error 1 _InTeNsDoWn_ Linux From Scratch 1 08-09-2005 01:47 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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