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

Re: single machine, different IP addresses



On Tue, 08 Feb 2011 13:14:39 +0000, T o n g wrote:

>>>>> Is it possible to make a single machine having/answering to
>>>>> different IP addresses (I'm using DNSmasq as the dns server)?
>>>>>
>>>> You can use a virtual interface:
>>>> 
>>>> ifconfig eth0:0 192.168.0.1 netmask 255.255.255.0
>>>> 
>>> IMO the better choice is to use ip tool. For example; ip a a
>>> 192.168.0.1/24 dev eth0
> 
> Besides that, I need to properly configure route, and no need to worry
> about dns server, correct? -- I don't need a dns name for the 2nd
> address, just an IP is enough.

Still need to know.

>> "ip" tool settings will lost after computer restarts unless you make an
>> script that sets the data on every network reboot... I think IP alias
>> (virtual interface) is the way to go.
> 
> How can it be possible, Camaleón?
> 
> I did a search, but found out otherwise --
> http://www.faqs.org/docs/Linux-mini/IP-Alias.html#KEEPSETTINGS Is it too
> old now (2001-01-23)?

Further search lead me to, 

Bind Multiple IP Addresses to a Single Network Interface Card (NIC)
http://www.xenocafe.com/tutorials/linux/redhat/
bind_multiple_ip_addresses_to_single_nic/index.php

Add an IP address for Non-SUSE distributions
http://www.oclc.org/support/documentation/ezproxy/technote/2l.htm

but both need to work on network scripts located in /etc/sysconfig/
network-scripts/, which we don't have in Debian. 

Then, I looked into /etc/network/interfaces.examples, and add the 
following to my /etc/network/interfaces:

 auto eth0.1
 iface eth0.1 inet manual
       pre-up vconfig add eth0.1
       up ifconfig eth0 0.0.0.0 promisc up
        address 192.168.0.101
       post-down vconfig rem eth0.1

But got this:

% /etc/init.d/networking restart
Reconfiguring network interfaces.../bin/sh: vconfig: not found
Failed to bring up eth0.1.

I need help. 
Thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/


Reply to: