Add Second IP in graphical in kubuntu 8.4

Asked by asgujju on 2009-09-29

hello

I am using kubuntu 8.4. I want to add second IP by graphical mode in kubuntu 8.4, is there possible? How to add?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
asgujju
Solved:
2009-10-01
Last query:
2009-10-01
Last reply:
2009-09-30

Do you mean 2 IPs to the same interface? Your question is very limited in data.

asgujju (asgujju) said : #2

yes i want add 2nd IPs in same interface. please guide to me....

thanks

Cristi Nistor (cristi-nistor) said : #3

Yes you can.

First you have to edit the file etc/network/interfaces using gedit or whatever text editor you like.
Type the command in a terminal:

sudo gedit /etc/network/interfaces

Then you should modify the content to look like this:

#first IP address

auto eth1
iface eth1 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.255 #this is optional
gateway 192.168.1.1

#seccond IP address

auto eth1:1
iface eth1:1 inet static
address 192.168.1.11
netmask 255.255.255.0
network 192.168.1.255 #this is optional
gateway 192.168.1.1

Note that you have to have static IPs, and to give the IP range suitable for your network. If you are behind a router it will be better to add some data to your router configuration, so the IPs assigned will be the same as in your interfaces file.

Don't forget to restart the network using the command:

/etc/init.d/networking restart

After this your can ping your NIC to see if is working.
Good luck.

Looks like someone got there before me. No bad thing, the entries look good except having 2 subinterfaces in the same network is fairly pointless. More common is to have the single device connected to a switch with Cisco like trunks which will then allow the NIC to function on 2 distinct LANs

auto eth0 eth0:1
iface eth0 inet static
     address 192.168.1.100
     network 192.168.1.0
     netmask 255.255.255.0
     gateway 192.168.0.1
 iface eth0:1 inet static
     address 192.168.0.200
     network 192.168.0.0
     netmask 255.255.255.0

Here the NIC is in the 192.168.1.0 network AND the 192.168.0.0 network. Having 2 subinterfaces on the same network will not get you any more speed as you are still using the same connection to the same router/switch.

Cristi Nistor (cristi-nistor) said : #5

Yes, you are wright. Ethernet is capable of handling multiple IP subnets and they share the same broadcast domain.

asgujju (asgujju) said : #6

Thanks