From owner-freebsd-net@freebsd.org Fri Jun 16 16:35:15 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD24C77CDA for ; Fri, 16 Jun 2017 16:35:15 +0000 (UTC) (envelope-from Steven@stream-technologies.com) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0074.outbound.protection.outlook.com [104.47.2.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4852217C; Fri, 16 Jun 2017 16:35:14 +0000 (UTC) (envelope-from Steven@stream-technologies.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=streamtechnologiesuk.onmicrosoft.com; s=selector1-streamtechnologies-com01e; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=EnTSWemcA9abnoZ10Ea6mATeac0NNXThLoteBX2gAK0=; b=AWQIDIGl/efRFozxz0MmnTvw9GwVxBeHMqlQSl7OFfQWI0XrNTdaflbqHXMm3yMYNtxJCvf9xEdMgl+JWeUu1mNCDjX4/XhqacUuBOiyUZVFSJJX/5HMerC7mnkqojtxmeJhhoA11N1YJAumQoX4BNuNhotXgCX5Hnfu76rH8yI= Received: from DB6PR07MB3111.eurprd07.prod.outlook.com (10.170.223.158) by DB6PR07MB3480.eurprd07.prod.outlook.com (10.175.234.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.6; Fri, 16 Jun 2017 16:35:11 +0000 Received: from DB6PR07MB3111.eurprd07.prod.outlook.com ([fe80::d90d:3874:163d:ca76]) by DB6PR07MB3111.eurprd07.prod.outlook.com ([fe80::d90d:3874:163d:ca76%13]) with mapi id 15.01.1199.007; Fri, 16 Jun 2017 16:35:11 +0000 From: Steven Crangle To: Alan Somers CC: FreeBSD Net Subject: Re: Possible bug in ifconfig regarding ip addresses and fibs Thread-Topic: Possible bug in ifconfig regarding ip addresses and fibs Thread-Index: AQHS5rmyqfU3WxD1JU2qp4KbhtfsE6InqUyAgAAFFn4= Date: Fri, 16 Jun 2017 16:35:10 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=stream-technologies.com; x-originating-ip: [2603:10a6:4:55:cafe::c] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR07MB3480; 7:9hC4BrQW0PsUMyTYzUBsjmhI4vMRd2cJdDG4qKHqyEnEmmP14fUb9JXC/O/MADYupjkMm2uQt+HOJoJfLnOUzWbqtbQqoAbL7pfzjGiXzK4vOnMjJdfq1Og/xxAbuGm6CVOXkEhSjuvyWadJ6vX/HBVExDHw0D14l2BizGVEhzRlCkOfrfvYDqqaTy1E/JPoILmqhL0CBehkITkPOzQRECYgjrCSnbhZSguDfJK5+/2SvfZcTWFPIf/3/uON/HI9/On8lIyKrXhAnYeq3IIK5Us10oOAZ+3B42q3Y72c+i26hLZ4GYHi2nllGEhyRrDON5EGtUQfaOfuCyX/RARnUlfqat5D1N2gy146w1VeKkLix8Eew3LVFsrmbsEhJvSeBPDTWXke50gdReREBa5mikvXxLUgiAHKDAc5kHA4abXvJhU7XMCsoJxkSmZadXXWN0I1NRqmI76WTnrQe3TXC1hZqa8yC1BeNkttw+Nak+h0JibG7BlkJqSbN8b9k8YNGsxrjMRbX+s2I6rzCOTmH7PBm/a1GzveAMSFTBhzSdd58fq5VhjAmrE86GfQKBje8gpjoHwbcq2sHDh8Cnta0/1sTHmPIR7M4xH1g4TW8pixaFJ/3eVfyaQhF7/m4R20a6y7mmNw+GvATGlzhOQkjefd9OBefiA7cwl7vGpr0wBSYrYFD86Rh2l5PPm5Jqh2iQFw7jMZJE+x0H29NJGWLA+S3B2BlRmUCy9ZQAsjs1/ubvYyed65//lLum/vVUfb8HuQM/pKf3XVmceM5H55/UasMP3xR5IvYzoot/8XDGw= x-ms-office365-filtering-correlation-id: caeebea0-eed2-4589-d60d-08d4b4d5a858 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DB6PR07MB3480; x-ms-traffictypediagnostic: DB6PR07MB3480: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(203790808753936)(266611908612381); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR07MB3480; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR07MB3480; x-forefront-prvs: 0340850FCD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39830400002)(39450400003)(39410400002)(39400400002)(24454002)(377454003)(450100002)(72206003)(9686003)(733005)(189998001)(7736002)(19273905006)(6246003)(6436002)(14454004)(86362001)(6506006)(236005)(7906003)(6306002)(54896002)(74316002)(53936002)(2900100001)(478600001)(110136004)(99286003)(33656002)(606005)(55016002)(5250100002)(38730400002)(2950100002)(4326008)(80792005)(6916009)(102836003)(6116002)(53546009)(3280700002)(3660700001)(5660300001)(229853002)(25786009)(2906002)(8936002)(7696004)(81166006)(8676002)(54356999)(76176999)(50986999)(16866105001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR07MB3480; H:DB6PR07MB3111.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: stream-technologies.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2017 16:35:10.9791 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 720fa073-5781-43bf-bc14-7bef2603ed21 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR07MB3480 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2017 16:35:15 -0000 Hi Alan, Thanks for the fast reply. I actually think I had the fib 5 part appended to the line previously, but = had somehow removed it in my repeated attempts! Either way, I just tried yo= ur solution, and it results in the same behaviour. The initial two IP's are assigned, but the final 192.168.124.216 is not. When i get chance, I'll try moving the mgmt IP from the 124 range to someth= ing else and repeating, as I'm sure it's some sort of interaction between m= anee and mgmt. Since the commands are successful if I change the final addr= esses IP to a different range! Thanks Steven ________________________________ [Stream Logo] Steven Crangle Systems Developer | Stream Technologies | Glasgow, UK [http://www.stream-technologies.com/img/phone.png] +44 (0)844 800 8520 | [http://www.stream-technologies.com/img/mouse.png] www.stream-technologies.com ________________________________ From: asomers@gmail.com on behalf of Alan Somers Sent: 16 June 2017 17:12:39 To: Steven Crangle Cc: FreeBSD Net Subject: Re: Possible bug in ifconfig regarding ip addresses and fibs On Fri, Jun 16, 2017 at 10:00 AM, Steven Crangle wrote: > > Hi, > > > I've been configuring a device with the following rc.conf lines: > > > ifconfig_le6_name=3D"manee" > ifconfig_manee=3D"fib 5 up" > ifconfig_manee_alias0=3D"inet 185.100.174.221 netmask 255.255.255.0" > ifconfig_manee_alias1=3D"inet 172.31.4.216 netmask 255.255.255.128" > ifconfig_manee_alias2=3D"inet 192.168.124.216 netmask 255.255.255.128" > > The result I would have expected is as follows: > > > manee: flags=3D8843 metric 0 mtu = 1500 > options=3D8 > ether 08:00:27:d3:83:da > inet 185.100.174.221 netmask 0xffffff00 broadcast 185.100.174.255 > inet 172.31.4.216 netmask 0xffffffc0 broadcast 172.31.4.255 > inet 192.168.124.216 netmask 0xffffff80 broadcast 192.168.124.255 > nd6 options=3D29 > media: Ethernet autoselect > status: active > fib: 5 > > > Instead I get the following on boot of the box: > > > manee: flags=3D8843 metric 0 mtu = 1500 > options=3D8 > ether 08:00:27:d3:83:da > inet 185.100.174.221 netmask 0xffffff00 broadcast 185.100.174.255 > inet 172.31.4.216 netmask 0xffffffc0 broadcast 172.31.4.255 > nd6 options=3D29 > media: Ethernet autoselect > status: active > fib: 5 > > > I then tried to run the following command: > > ifconfig manee alias 185.100.174.221 netmask 255.255.255.0 > ifconfig manee alias 172.31.4.216 netmask 255.255.255.128 > ifconfig manee alias 192.168.124.216 netmask 255.255.255.128 > > Which resulted in the following output: > > > ifconfig: ioctl (SIOCAIFADDR): File exists > > After this I tried: > > ifconfig manee -alias > > Which seemed to wipe all addresses fro mthe device as expected. > > > I then started again using ifconfig lines to assign the aliases to the de= vice, they all succeed apart from when I get to the 192.168.124.216 one. Wh= ich again outputs the following: > > > ifconfig: ioctl (SIOCAIFADDR): File exists > > Even though running ifconfig only shows the first two addresses configure= d. > > > Note: I also have a mgmt interface on fib 0 configured with the ip : 192.= 168.124.250 > > From investigation it seems to somehow be clashing with this, as I am abl= e to add a 3rd alias with the following line: > > > ifconfig manee alias 192.168.125.216 netmask 255.255.255.128 > > Is it not possible to have two IP Addresses on the same range, but differ= ent addresses on seperate fibs? > > Thanks for any help! > > Steven There is some subtlety with using multiple fibs. Your problem is that you naturally assumed that by assigning fib 5 to the manee interface, that fib would also be used for all of its addresses. However, that's not the way it works. The interface fib actually isn't very important. It's only used for packet forwarding. The fib of an interface address is more important, and each address can have a different fib, even when they share an interface. In order to set the interface address fibs, do this: ifconfig_manee_alias0=3D"inet 185.100.174.221 netmask 255.255.255.0 fib 5" ifconfig_manee_alias1=3D"inet 172.31.4.216 netmask 255.255.255.128 fib 5" ifconfig_manee_alias2=3D"inet 192.168.124.216 netmask 255.255.255.128 fib 5= " You can't assign the same address to multiple interfaces with the same FIB. -Alan