[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHCP with Static Addresses



On Thursday 24 November 2005 1:29 pm, Kenneth Jacker wrote:
> [ sarge ]
>
> Looking in interfaces(5), it doesn't appear that I can include an
> "address" line (where I could specify a desired address) within
> /etc/network/interfaces for a 'dhcp'-configured interface.
>
> However, what I'd like to do somehow is make my RFC1819 addresses
> remain the same at home, but still use DHCP for DNS, etc.  Depending
> on what I boot when, the addresses all change thus messing up firewall
> settings and other "stuff".
>
> Maybe I must just go with "iface ... static" instead of "iface ... dhcp"?
>
> What would people suggest for this?
>
> Thanks,
> --
> Prof Kenneth H Jacker       khj@cs.appstate.edu
> Computer Science Dept       www.cs.appstate.edu/~khj
> Appalachian State Univ
> Boone, NC  28608  USA


I solved the problem by configuring a second IP to the interface statically 
in /etc/network/interfaces:

# The primary network interface
auto eth0
iface eth0 inet dhcp

# Server IP
auto eth0:1
iface eth0:1 inet static
address 192.168.11.10
netmask 255.255.255.0

There are a couple advantages to this.... my favorite is that I can portmap to 
the static address in my router and only bind those services to the static IP 
while services I use internally (such as samba) are hosted on the dynamic IP.

I hope this helped!

Joe



Reply to: