3

I configured network bonding on two machine with centos 5.5. Bonding works well, but the problem is default gateway: it is not configured!

I follow this tutorial. I added GATEWAY in both (and either) /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-bond0. But, when I restart network (or server) there is no default gateway (route command).

This is ip route ls output after network restart:

10.0.0.0/16 dev bond0 proto kernel scope link src 10.0.0.88

Where is my mistake?

/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
IPV6INIT=no
HOSTNAME=mysql2
NOZEROCONF=yes
GATEWAY=10.0.1.10

/etc/sysconfig/network-scripts/ifcfg-bond0 
DEVICE=bond0
IPADDR=10.0.0.88
NETMASK=255.255.0.0
NETWORK=10.0.0.0/16
BROADCAST=10.0.255.255
GATEWAY=10.0.1.10
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
lg.
  • 4,649
  • 3
  • 21
  • 20

4 Answers4

2
NETWORK=10.0.0.0/16

I don't think this is specified correctly. It should be just

NETWORK=10.0.0.0

or try leaving it out entirely its redundant information

hellomynameisjoel
  • 2,172
  • 2
  • 18
  • 23
1

TrevorH (a linux sysadmin) solved my problem (I post my question also into centos forum).

Removing NETWORK and BROADCAST lines from ifcfg-bond0, the default gateway is configured.

lg.
  • 4,649
  • 3
  • 21
  • 20
0

The correct place for the default gateway is /etc/sysconfig/network - remove it from your bond scripts. Also ensure that your route defined as

GATEWAY=x.x.x.x

What does ip route ls show after service network restart

Andrew Taylor
  • 884
  • 4
  • 6
  • I didn't wrote, but I also tried to remove GATEWAY from bond script. Now, I add ip route output into my question. – lg. Jan 10 '11 at 14:25
0

You cannot use booth like that, or you set network=10.0.0.0/16 without netmask or you set network=10.0.0.0 and netmask=255.255.0.0.

Regards.

voodooo
  • 254
  • 2
  • 6