Bug 106269
Summary: | Default route is always out highest numbered interface on multihomed box. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Terje Bless <link> |
Component: | initscripts | Assignee: | Bill Nottingham <notting> |
Status: | CLOSED NOTABUG | QA Contact: | Brock Organ <borgan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | rvokal |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-06-07 19:56:18 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Terje Bless
2003-10-04 14:34:58 UTC
What does your /etc/sysconfig/network-scripts/ifcfg-* and /etc/sysconfig/network look like in the case that doesn't work for you? I modified the IPs and snipped the MAC addresses (on general principle). You can assume the 192.168.1.0/24 network is a public IP network (i.e. non-RFC1918). The below is the non-working version; adding "GATEWAYDEV=eth0" to /etc/sysconfig/network makes it work. :::::::::::::: /etc/sysconfig/network :::::::::::::: NETWORKING=yes HOSTNAME=lamb.example.com GATEWAY=192.168.1.1 :::::::::::::: /etc/sysconfig/network-scripts/ifcfg-eth0 :::::::::::::: # Intel Corp.|82801BA/BAM/CA/CAM Ethernet Controller DEVICE=eth0 BOOTPROTO=none BROADCAST=192.168.1.255 HWADDR=[snipped] IPADDR=192.168.1.12 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes TYPE=Ethernet USERCTL=no PEERDNS=no GATEWAY=192.168.1.1 :::::::::::::: /etc/sysconfig/network-scripts/ifcfg-eth1 :::::::::::::: # Macronix, Inc. [MXIC]|MX987x5 DEVICE=eth1 BOOTPROTO=none HWADDR=[snipped] ONBOOT=yes TYPE=Ethernet USERCTL=no PEERDNS=no NETMASK=255.255.255.0 IPADDR=172.20.100.21 GATEWAY=172.20.100.1 So, it sets the default route via 192.168.1.1, yet on device eth1? Or it makes 172.20.100.1 the default route? It sets the default route to 172.20.100.1. As best I've been able to tell from browsing the relevant bits of code, what happens is that on the interface last brought up it will forcibly remove any existing default route and add in a new one. I suspect it's this code from line 360 of "ifup": -- cut # Set a default route. if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then # set up default gateway. replace if one already exists if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then ip route replace default via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then ip route replace default ${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} fi fi -- cut But I'm afraid I speak shell too little to be sure I grok this. IIRC, the problem is that the GATEWAY in ifcfg-* will override the GATEWAY in /etc/sysconfig/network. So you don't know that there's a global preference without GATEWAYDEV. The documentation in sysconfig.txt has been clarified a little in CVS for future builds. The behavior you're seeing is pretty much what's expected in the absence of GATEWAYDEV, though. |