Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not add virtual interfaces #63

Open
dominikkukacka opened this issue Sep 25, 2017 · 4 comments
Open

Can not add virtual interfaces #63

dominikkukacka opened this issue Sep 25, 2017 · 4 comments

Comments

@dominikkukacka
Copy link

dominikkukacka commented Sep 25, 2017

I tried to add a virtual interface to eth1:

- device: eth1:0
        description: eth1:0 - mydomain.com
        auto: true
        family: inet
        method: static
        address: 1.2.3.4
        netmask: 255.255.255.248
        gateway: 1.2.3.1
        allow:
          - hotplug

which resulted in this error:

dresden-weekly.ansible-network-interfaces : network restart interface command
...
"stderr": "ifdown: interface eth1:0 not configured\nRTNETLINK answers: File exists", 
"stdout": "Failed to bring up eth1:0.",
...

The interface file is written but the restart failes.
And yes the interface is already there and up. But should this not work anyway? (It does for eth0/eth1)

@arBmind
Copy link
Member

arBmind commented Sep 25, 2017

This reminds me of the old days, when we used virtual interfaces like that. Today, we just add more IP addresses to a single interface.

What system does still support this old behavior?

@dominikkukacka
Copy link
Author

dominikkukacka commented Sep 25, 2017 via email

@arBmind
Copy link
Member

arBmind commented Sep 25, 2017

Just add them to the routes on up and remove them on down

- device: eth1
  #
  # add additional IPs
  up:
    - "route add -net 1.2.3.4 netmask 255.255.255.248 gw 1.2.3.1 eth1"
  down:
    - "route delete -net 1.2.3.4 netmask 255.255.255.248 gw 1.2.3.1 eth1"

@arBmind
Copy link
Member

arBmind commented Sep 25, 2017

I guess the main issue here is that we generate an illegal filename.
Maybe someone can fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants