Project

General

Profile

Bug #11440

Updated by Dominic Cleal over 8 years ago

Hello. 

 I provisioned the physical server with bonded two interfaces and the final provisioned server didn't have default gateway configured properly. 

 I successfully create the host and created bond properly for CentOS6 server: 

 <pre> 
 hammer host create --model "ProLiant BL685c G1" --medium "My_CentOS_mirror" --name "server01.example.com" --operatingsystem-id $OPERATINGSYSTEM_ID --partition-table-id $PARTITION_TABLE_ID --root-pass "12345678" \ 
  --puppet-proxy-id 1 --architecture-id $ARCHITECTURE_ID --environment-id $ENVIRONMENT_ID --domain-id $DOMAIN_ID --hostgroup "hosts" \ 
  --interface="type=bond,mac=00:1E:0B:20:FE:3A,ip=10.2.4.5,name=server01-oam,subnet_id=$SUBNET_OAM_ID,domain_id=$DOMAIN_ID,mode=balance-rr,attached_devices=[eth0,eth1],identifier=bond0,primary=true,provision=true" \ 
  --interface="type=bond,mac=00:1c:c4:a6:f4:90,ip=10.2.4.131,name=server01-traffic,subnet_id=$SUBNET_TRAFFIC_ID,domain_id=$DOMAIN_ID,mode=balance-rr,attached_devices=[eth4,eth5],identifier=bond1" \ 
  --interface="type=bond,mac=00:1c:c4:a6:f4:92,ip=192.168.0.5,name=server01-internal,subnet_id=$SUBNET_INTERN_ID,domain_id=$DOMAIN_ID,mode=balance-rr,attached_devices=[eth6,eth7],identifier=bond2" \ 
  --interface="type=interface,mac=00:1E:0B:20:FE:3A,identifier=eth0" \ 
  --interface="type=interface,mac=00:1E:0B:20:FE:3E,identifier=eth1" \ 
  --interface="type=interface,mac=00:1C:C4:AB:E9:45,identifier=eth2" \ 
  --interface="type=interface,mac=00:1C:C4:AB:E9:46,identifier=eth3" \ 
  --interface="type=interface,mac=00:1c:c4:a6:f4:90,identifier=eth4" \ 
  --interface="type=interface,mac=00:1c:c4:a6:f4:91,identifier=eth5" \ 
  --interface="type=interface,mac=00:1c:c4:a6:f4:92,identifier=eth6" \ 
  --interface="type=interface,mac=00:1c:c4:a6:f4:93,identifier=eth7" 
 </pre> 

 


 I can see these lines especially the "DEFROUTE=no" in the Kickatrt template generated for the server: 

 <pre> 
 # bond0 interface 
 real="bond0" 
 cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real 
 BOOTPROTO="dhcp" 
 DEVICE="$real" 
 ONBOOT=yes 
 PEERDNS=no 
 PEERROUTES=no 
 DEFROUTE=no 
 TYPE=Bond 
 BONDING_OPTS=" mode=balance-rr" 
 BONDING_MASTER=yes 
 NM_CONTROLLED=no 
 EOF 
 </pre> 

 Parameter "DEFROUTE=no" disables of using the default gateway specified by DHCP or specified in /etc/sysconfig/network in case of static configuration. 

 
 -> This is most probably the bug. I suggest to remove this line when generating the bond configuration (like it's in case of standard "eth" interfaces) 

 
 -> Maybe it's enough to remove this line from "/usr/share/foreman/app/views/unattended/snippets/_kickstart_networking_setup.erb" (I'm not sure) 


 Here are the details form the provisioned server: 

 <pre> 
 # cat /etc/sysconfig/network-scripts/ifcfg-bond0 
 BOOTPROTO="dhcp" 
 DEVICE="bond0" 
 ONBOOT=yes 
 PEERDNS=no 
 PEERROUTES=no 
 DEFROUTE=no 
 TYPE=Bond 
 BONDING_OPTS=" mode=balance-rr" 
 BONDING_MASTER=yes 
 NM_CONTROLLED=no 

 # ip r s 
 10.2.4.0/25 dev bond0    proto kernel    scope link    src 10.2.4.5 
 10.2.4.128/25 dev bond1    proto kernel    scope link    src 10.2.4.131 
 192.168.0.0/24 dev bond2    proto kernel    scope link    src 192.168.0.5 
 169.254.0.0/16 dev bond0    scope link    metric 1010 
 169.254.0.0/16 dev bond1    scope link    metric 1011 
 169.254.0.0/16 dev bond2    scope link    metric 1012 
 </pre> 

 -> No default GW configured above! 


 I removed manually the "DEFROUTE=no" from "/etc/sysconfig/network-scripts/ifcfg-bond0" + restart the networking and everything starts working like it should be: 

 <pre> 
 # ip r s | grep default 
 default via 10.2.4.1 dev bond0 
 </pre> 

 Thank you for looking at it. 

 PetrR

Back