LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-20-2014, 05:11 AM   #1
akiuni
Member
 
Registered: Sep 2012
Location: France
Distribution: debian
Posts: 56

Rep: Reputation: Disabled
changing subnet mask can dropp all ip aliases


Hello everybody,

I've noticed a strange behavior on a debian box (with kernel 3.2.58) and I'd like to ask networking experts for an answer...

Let's create the following configuration (you can use "ip addr", it doesn't matter)
Code:
# ifconfig eth0 192.168.150.32 netmask 255.255.255.0
# ifconfig eth0:1 192.168.150.7 netmask 255.255.255.0
Then, try to change the netmaking mask :
Code:
# ifconfig eth0 192.168.150.32 netmask 255.255.255.128
The ip alias (eth0:1) will be dropped..

Here is the "ip monitor" trace :
Code:
3: eth0    inet 192.168.150.7/24 brd 192.168.150.255 scope global secondary eth0:1
local 192.168.150.7 dev eth0  table local  proto kernel  scope host  src 192.168.150.32
192.168.150.34 dev eth0 lladdr 08:00:27:b1:36:e0 STALE
192.168.150.33 dev eth0 lladdr 08:00:27:b1:36:e0 STALE
Deleted 3: eth0    inet 192.168.150.7/24 brd 192.168.150.255 scope global secondary eth0:1
Deleted local 192.168.150.7 dev eth0  table local  proto kernel  scope host  src 192.168.150.32
Deleted 3: eth0    inet 192.168.150.32/24 brd 192.168.150.255 scope global eth0
Deleted 192.168.150.0/24 dev eth0  proto kernel  scope link  src 192.168.150.32
Deleted broadcast 192.168.150.255 dev eth0  table local  proto kernel  scope link  src 192.168.150.32
Deleted broadcast 192.168.150.0 dev eth0  table local  proto kernel  scope link  src 192.168.150.32
Deleted local 192.168.150.32 dev eth0  table local  proto kernel  scope host  src 192.168.150.32
192.168.150.1 dev eth0 lladdr 84:2b:2b:fd:28:bb NOARP
192.168.150.33 dev eth0 lladdr 08:00:27:b1:36:e0 NOARP
224.0.0.22 dev eth0 lladdr 01:00:5e:00:00:16 NOARP
192.168.150.34 dev eth0 lladdr 08:00:27:b1:36:e0 NOARP
3: eth0    inet 192.168.150.32/25 brd 192.168.150.127 scope global eth0
local 192.168.150.32 dev eth0  table local  proto kernel  scope host  src 192.168.150.32
broadcast 192.168.150.127 dev eth0  table local  proto kernel  scope link  src 192.168.150.32
192.168.150.0/25 dev eth0  proto kernel  scope link  src 192.168.150.32
broadcast 192.168.150.0 dev eth0  table local  proto kernel  scope link  src 192.168.150.32
I'm not an expert but it seems that the ip alias (eth0:1) is dropped. Note that this behavior doesn't appear with ip configured on two separated subnets.

Can you tell me if this behavior is normal and if there is a way to prevent it ?
Thanks !
Best regards
julien
 
Old 05-20-2014, 08:25 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
aliases must be in the same subnet as the primary on a given NIC. When you change the mask on the primary you've changed its subnet but have not yet changed the one for the alias so they're no longer in the same subnet. Fix would be to change the mask on both the primary (first) and the alias (second).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
subnet mask is changing automatically in fedora 10 abhattacharya Fedora 2 12-23-2008 11:53 AM
What is Subnet Mask? cousinlucky Linux - Networking 21 10-17-2007 11:08 AM
Subnet Mask jomyjose Linux - Networking 2 08-01-2006 09:19 AM
subnet mask kizersouzay Linux - Networking 1 08-31-2005 03:07 PM
Subnet mask mikeshn Linux - Networking 1 08-26-2002 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration