Networking Forums

Networking Forums > Computer Networking > Linux Networking > 2 ip addresses on same network card

Reply
Thread Tools Display Modes

2 ip addresses on same network card

 
 
Sotiris Rentoulis
Guest
Posts: n/a

 
      05-13-2005, 07:53 AM
Dear friends,

How could I assign two different IP addresses to the same network card?
The addresses are: 10.0.0.1/255.0.0.0 and 89.0.0.1/255.255.255.0.
Is there a "tool" to make such an assignment easier?
The current IP address is 89.0.0.1

Thanks in advance,
Sotiris.


 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      05-13-2005, 08:04 AM
On 2005-05-13, Sotiris Rentoulis <(E-Mail Removed)> wrote:
> How could I assign two different IP addresses to the same network card?


Using ifconfig ethx:1, ifconfig ethx:2, ifconfig ethx:3 ....
man ifconfig for more info.

Davide

--
Windows NT: Only 16 megs needed to play Minesweeper!
 
Reply With Quote
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      05-13-2005, 09:52 AM
Davide Bianchi wrote:
> Using ifconfig ethx:1, ifconfig ethx:2, ifconfig ethx:3 ....
> man ifconfig for more info.


That would add secondary addresses to the interface, but you
can add primary addresses with the "ip" tool from iproute2.

> Davide


Regards.

--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      05-13-2005, 03:06 PM
"Sotiris Rentoulis" <(E-Mail Removed)> writes:

> Dear friends,


>How could I assign two different IP addresses to the same network card?
>The addresses are: 10.0.0.1/255.0.0.0 and 89.0.0.1/255.255.255.0.
>Is there a "tool" to make such an assignment easier?
>The current IP address is 89.0.0.1


Why would you want to?



 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      05-13-2005, 04:26 PM
Unruh wrote:

> "Sotiris Rentoulis" <(E-Mail Removed)> writes:
>
>> Dear friends,

>
>>How could I assign two different IP addresses to the same network card?
>>The addresses are: 10.0.0.1/255.0.0.0 and 89.0.0.1/255.255.255.0.
>>Is there a "tool" to make such an assignment easier?
>>The current IP address is 89.0.0.1

>
> Why would you want to?


He might want to give both a local network and real world address to the
same computer.

 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      05-13-2005, 06:42 PM
Sotiris Rentoulis wrote:
> Dear friends,
>
> How could I assign two different IP addresses to the same network card?
> The addresses are: 10.0.0.1/255.0.0.0 and 89.0.0.1/255.255.255.0.
> Is there a "tool" to make such an assignment easier?
> The current IP address is 89.0.0.1
>
> Thanks in advance,
> Sotiris.
>
>


The 89.x.y.z address range is reserved.

If you really try to use it, please *don't*.

There are prefectly good address ranges in RFC 1819 for
private use:

10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255

--

Tauno Voipio
tauno voipio (at) iki fi

 
Reply With Quote
 
Chris Lowth
Guest
Posts: n/a

 
      05-13-2005, 10:11 PM
Jose Maria Lopez Hernandez wrote:


> That would add secondary addresses to the interface


Strictly speaking: no, it creates sub interfaces and associates IPs with
them.

Chris

--
http://www.lowth.com/rope - Nice'n'easy scripting language for writing
your own iptables packet matching logic.

See it in action for controlling the Gnutella protocol at..
http://www.lowth.com/rope/BlockingGnutella
 
Reply With Quote
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      05-14-2005, 07:28 AM
Chris Lowth wrote:
> Strictly speaking: no, it creates sub interfaces and associates IPs with
> them.


If you do a:
iconfig eth0:1 192.168.7.2
ip addr show

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:00:39:64:2b:81 brd ff:ff:ff:ff:ff:ff
inet 192.168.7.1/24 brd 192.168.7.255 scope global eth0
inet 192.168.7.2/24 brd 192.168.7.255 scope global secondary eth0:1
inet6 fe80::200:39ff:fe64:2b81/64 scope link
valid_lft forever preferred_lft forever

It will show you that they are just secondary addresses to the main
interface. Really both things are the same, you just view them as
one thing or the other using one tool or the other.

> Chris


Regards.

--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
k.mukkamala@gmail.com
Guest
Posts: n/a

 
      05-23-2005, 09:14 AM
It depends on the OS u are using.

In linux you can do it by creating subinterfaces, but procedure is
different.

In RHLinux
======
you have to create a interface configuration file in
/etc/sysconfig/network-scripts/ifcfg-eth:x for each subinterface
(number x). e.g.,

for 10.0.0.1/255.0.0.0 to be associated with eth0:1 interfae create a
file /etc/sysconfig/network-scripts/ifcfg-eth0:1 and add the following
information

DEVICE=eth0:1
ONBOOT=yes/no (if u want the if comeup auto)
BOOTPROTO=static
IPADDR=10.0.0.1
NETMASK=255.255.255.0
NETWORK=10.0.0.0
TYPE=Ethernet
GATEWAY=10.0.0.x

Thats it and run 'service network restart'

KIRAN

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 IP Addresses 1 Nic card Don Glover Windows Networking 1 02-24-2007 11:32 AM
DHCP Server Leasing Addresses to MAC Addresses of 00-00-00-00-00-00 nomorespameventhoughthejapanesespamgivesmeachuckle Linux Networking 9 12-05-2006 09:49 PM
VPN Network Addresses Geoff Lane Home Networking 3 10-04-2003 07:33 AM
VPN Network Addresses Geoff Lane Windows Networking 3 10-04-2003 06:40 AM
RH - setting IP addresses on second ethernet card Gregg Germain Linux Networking 3 07-15-2003 01:48 PM



1 2 3 4 5 6 7 8 9 10 11