5

I have a Linux network Bonding interface for two Ethernet interfaces (eth0 and eth1)

$ cat /etc/sysconfig/network-scripts/ifcfg-bond0   
DEVICE=bond0  
BOOTPROTO=static  
ONBOOT=yes  
IPADDR=XX.XX.XX.XX  
NETMASK=255.255.255.0  
GATEWAY=XX.XX.XX.XXX  

How i can add another IPADDR to this bonding Interface ?

Mikel
  • 56,387
  • 13
  • 130
  • 149
WAEL
  • 1,509
  • 4
  • 11
  • 16

1 Answers1

7

What you want is called an Interface Alias.

Based on the files you mention, I think you're on Fedora, Red Hat or similar.

Their Interface Configuration Files Reference Guide suggest you want a new file called /etc/sysconfig/network-scripts/ifcfg-bond0:0 containing

DEVICE=bond0:0
IPADDR=XX.XX.XX.YY

I assume you also need the other entries, e.g.

BOOTPROTO=static
ONBOOT=yes
NETMASK=255.255.255.0
GATEWAY=XX.XX.XX.XXX
Mikel
  • 56,387
  • 13
  • 130
  • 149
  • Thank Mikel for your help i am using Ret Hat shall i add only these two lines you mentioned in the new file ??? – WAEL Jul 25 '12 at 14:27
  • I'm guessing you also want to specify `NETMASK` and `GATEWAY`. And the docs say DHCP is not supported, so you may need `BOOTPROTO` too. – Mikel Jul 25 '12 at 14:29
  • Do i need to restart anything after creating this file ? – WAEL Jul 25 '12 at 14:30
  • I'd try `ifup bond0:0` first. If that doesn't work, try `/etc/init.d/network restart`. – Mikel Jul 25 '12 at 14:32
  • Welcome! Please try it and let us know if it works. – Mikel Jul 25 '12 at 14:41
  • Thanks Mikel its working great, that is exactly what i want thanks for your help – WAEL Jul 26 '12 at 05:54