# static IP addressing issue

Category: Geeks r Us

## Post 1 by Squiggles (Account disabled) on Tuesday, 25-Dec-2007 1:00:21

here is the problem. And please, out of respect, only reply if you are knowledgable in this subject. I have formatted my server machine with Debian. Now all servers really should have a static IP address. I have 3 available IP addresses on my lan because that is all i really need. So, when I set my static IP on the server by doing
ifconfig 172.16.1.2 netmask 255.255.255.0
I reboot and the changes still do not change and the box continues to grab a dynamic IP. Now when I install webmin and go in and do it that way, the IP sticks. Now here is the problem. I can access my website and ftp locally on the port 21 and 8080, and I even have those ports forwarded on that IP of 1.2, but still, no one can access the site or ftp. However, if I stick the dhcp IP address of 1.8, and forward the same ports it works and I can access it locally and as well as remotely. Why will it work with dhcp and not a static IP? I may be missing something here simple but I can not pinpoint what I've not configured. Thanks.

## Post 2 by The Roman Battle Mask (Making great use of my Employer's time.) on Tuesday, 25-Dec-2007 14:14:14

First what is your network setup? Assuming you are using a router that allows it why not just have the router automatically assign a static IP to your server machine and then set up port forwarding to that particular address? Second if you are using the ip address 172.16.1.2 why? You should use a 192.168.x.xx where x.xx are the routers defaults assuming you have a modem plugged into a router which is then plugged into your computers. Third google something like assign static ip to ubuntu server and it'll show you how to edit the interfaces file to give you a static ip, ifconfig changes normally don't stick through a reboot.

## Post 3 by Squiggles (Account disabled) on Tuesday, 25-Dec-2007 14:29:01

1. I have done the research on how to edit that file, but that file does not exist.
2. I don't want a class C address I want a class B
3. I assign the ip address on the box and forward that port on the router. A router cannot assign a static IP, only a dynamic one, unless it is reserved.
4. That command ifconfig 172.16.1.2 netmask 255.255.255.0 should work, as my homework has told me it would but does not, but webmin works fine.

## Post 4 by The Roman Battle Mask (Making great use of my Employer's time.) on Tuesday, 25-Dec-2007 20:09:10

Install the init package then. Why do you want a class b address, when you only have three computers on the network? That makes things more complicated then necessary.

## Post 5 by Squiggles (Account disabled) on Thursday, 27-Dec-2007 6:31:11

Doesn't matter why I want a B address, that has nothing to do with my problem. I could have a class A it still wouldn't matter.
I'm certain all linux distros come with the init package. Otherwise how would I have all my init scripts in /etc/init.d?

## Post 6 by Chris N (I just keep on posting!) on Friday, 28-Dec-2007 16:17:21

I think those scripts are in the initscripts package. Try looking in /etc/network/interfaces which should have a commented static interface that you can work from.