LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to make IP static (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-make-ip-static-407161/)

Zeno McDohl 01-23-2006 08:34 PM

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?

microsoft/linux 01-23-2006 08:59 PM

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.

carl0ski 01-23-2006 09:11 PM

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

Zeno McDohl 01-23-2006 10:55 PM

Wait, so if I have a router I use the gateway IP?

microsoft/linux 01-23-2006 11:18 PM

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?

Zeno McDohl 01-23-2006 11:19 PM

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.

microsoft/linux 01-23-2006 11:33 PM

your router firewall shouldn't be affecting internal ip addresses. Could you provide some more information please? Is it a wireless router?

Zeno McDohl 01-23-2006 11:40 PM

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.

timmeke 01-24-2006 02:15 AM

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.

Zeno McDohl 01-24-2006 05:15 PM

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.

bosewicht 01-24-2006 05:36 PM

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

Zeno McDohl 01-24-2006 05:39 PM

I assume I have to put that in a file? I've been using netconfig... Why can't I use netconfig?

bosewicht 01-24-2006 05:52 PM

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

Zeno McDohl 01-24-2006 05:59 PM

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".

bosewicht 01-24-2006 06:09 PM

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.


All times are GMT -5. The time now is 07:24 PM.