From owner-freebsd-net@freebsd.org Sat Mar 10 22:13:36 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B38BF388CD for ; Sat, 10 Mar 2018 22:13:36 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from msa1.earth.yoonka.com (yoonka.com [88.98.225.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "msa1.earth.yoonka.com", Issuer "msa1.earth.yoonka.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C6D7C862F8 for ; Sat, 10 Mar 2018 22:13:35 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from crayon2.yoonka.com (crayon2.yoonka.com [10.70.7.20]) (authenticated bits=0) by msa1.earth.yoonka.com (8.15.2/8.15.2) with ESMTPSA id w2AM1TTB031889 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 10 Mar 2018 22:01:29 GMT (envelope-from list1@gjunka.com) To: freebsd-net@freebsd.org From: Grzegorz Junka Subject: Incorrect route interface Message-ID: <9dd657bc-ad58-f5cb-327a-572a561f1d6b@gjunka.com> Date: Sat, 10 Mar 2018 22:01:29 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB-large X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2018 22:13:36 -0000 Hi All, I have 2 NICs, one built-in with two ports em0 and em1 and one PCI card with 4 ports igb0-3. Only em0 is connected to the router. Then igb0 is connected to another system which isn't connected anywhere. FreeBSD somehow insists on directing all traffic through igb0 rather than em0. netstat -rn gives me: Destination  Gateway    Flags   Netif Expire default      10.20.2.1  UGS       em0 10.20.0.0/16 link#1     U        igb0 10.20.2.14   link#5     UHS       lo0 10.20.2.15   link#6     UHS       lo0 ... And so on, links 1-6 are then listed similarly to link5 and 6. In rc.conf I have: hostname="some.server.com" ifconfig_em0="inet 10.20.2.14 netmask 255.255.0.0" ifconfig_em1="inet 10.20.2.15 netmask 255.255.0.0" ifconfig_igb0="inet 10.20.2.16 netmask 255.255.0.0" ... defaultrouter="10.20.2.1 -ifp em0" static_routes="lan" route_lan="-net 10.20.0.0/16 -interface em0 -fib 0" In dmesg I am getting warnings: add host 127.0.0.1: gateway lo0 fib 0: route already in the table add net 10.20.0.0: gateway em0 fib 0: route already in the table add net default: gateway 10.20.2.1 Additional inet routing options: gateway=YES. add host ::1: gateway lo0 fib 0: route already in the table ... I actually don't know if all traffic goes through igb0, I assumed so looking at this position in the table: 10.20.0.0/16 link#1     U        igb0 Why default      10.20.2.1  UGS       em0 10.20.0.0/16 link#1     U        igb0 have different interfaces and how can I configure the network to direct all traffic through em0? ping 10.20.2.1 doesn't work, it says: ping: sendto: Host is down Can anyone please help? GregJ