-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MTV-1711 | Keep static IP on Debian based interfaces
Issue: All Debian-based operating systems can have the network configurations in the `/etc/network/interfaces`. Right now we are not fetching information from these config files when creating the udev rule to set the interface name. Fix: Add a new function to the `network_config_util.sh` script. I have decided to use the `ifquery` inside the guest. Alternatively, we would need to start parsing the config files. We can easily grep the IP address from the configfile and find the interface name but there could be multiple interface configurations inside one file. Docs: https://man.cx/interfaces(5) Signed-off-by: Martin Necas <mnecas@redhat.com>
- Loading branch information
Showing
12 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...-v2v/pkg/customize/scripts/rhel/run/network-interfaces-multiple-test.d/expected-udev.rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="aa:bb:cc:dd:ee:ff",NAME="ens192" | ||
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="aa:bb:cc:dd:ee:fe",NAME="eth0" |
8 changes: 8 additions & 0 deletions
8
...customize/scripts/rhel/run/network-interfaces-multiple-test.d/root/etc/network/interfaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file describes the network interfaces available on your system | ||
# and how to activate them. For more information, see interfaces(5). | ||
|
||
source /etc/network/interfaces.d/* | ||
|
||
# The loopback network interface | ||
auto lo | ||
iface lo inet loopback |
5 changes: 5 additions & 0 deletions
5
...ripts/rhel/run/network-interfaces-multiple-test.d/root/etc/network/interfaces.d/if-ens192
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# The primary network interface | ||
auto ens192 | ||
iface ens192 inet static | ||
address 10.184.121.84/24 | ||
gateway 10.184.121.1 |
5 changes: 5 additions & 0 deletions
5
...scripts/rhel/run/network-interfaces-multiple-test.d/root/etc/network/interfaces.d/if-eth0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# The primary network interface | ||
auto eth0 | ||
iface eth0 inet static | ||
address 192.168.1.11/24 | ||
gateway 192.168.1.1 |
3 changes: 3 additions & 0 deletions
3
virt-v2v/pkg/customize/scripts/rhel/run/network-interfaces-multiple-test.d/root/tmp/macToIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
aa:bb:cc:dd:ee:ff:ip:10.184.121.84,things,more | ||
aa:bb:cc:dd:ee:fe:ip:192.168.1.11,hello,world | ||
aa:bb:cc:dd:ee:fd:ip:192.168.1.12,ipv6,support |
1 change: 1 addition & 0 deletions
1
virt-v2v/pkg/customize/scripts/rhel/run/network-interfaces-single-test.d/expected-udev.rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="aa:bb:cc:dd:ee:ff",NAME="ens192" |
14 changes: 14 additions & 0 deletions
14
...g/customize/scripts/rhel/run/network-interfaces-single-test.d/root/etc/network/interfaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file describes the network interfaces available on your system | ||
# and how to activate them. For more information, see interfaces(5). | ||
|
||
source /etc/network/interfaces.d/* | ||
|
||
# The loopback network interface | ||
auto lo | ||
iface lo inet loopback | ||
|
||
# The primary network interface | ||
auto ens192 | ||
iface ens192 inet static | ||
address 10.184.121.84/24 | ||
gateway 10.184.121.1 |
3 changes: 3 additions & 0 deletions
3
virt-v2v/pkg/customize/scripts/rhel/run/network-interfaces-single-test.d/root/tmp/macToIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
aa:bb:cc:dd:ee:ff:ip:10.184.121.84,things,more | ||
aa:bb:cc:dd:ee:fe:ip:192.168.1.11,hello,world | ||
aa:bb:cc:dd:ee:fd:ip:192.168.1.12,ipv6,support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters