Configure VM network iface on attach (not only on boot) (#190)
This commit is contained in:
parent
1108ecd1dc
commit
59da079f22
2
common/qubes_network.rules
Normal file
2
common/qubes_network.rules
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
SUBSYSTEMS=="xen", KERNEL=="eth*", ACTION=="add", RUN+="/usr/lib/qubes/setup_ip"
|
12
common/setup_ip
Executable file
12
common/setup_ip
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
ip=`/usr/bin/xenstore-read qubes_ip`
|
||||
netmask=`/usr/bin/xenstore-read qubes_netmask`
|
||||
gateway=`/usr/bin/xenstore-read qubes_gateway`
|
||||
secondary_dns=`/usr/bin/xenstore-read qubes_secondary_dns`
|
||||
if [ x$ip != x ]; then
|
||||
/sbin/ifconfig $INTERFACE $ip netmask 255.255.255.255 up
|
||||
/sbin/route add default dev $INTERFACE
|
||||
echo "nameserver $gateway" > /etc/resolv.conf
|
||||
echo "nameserver $secondary_dns" >> /etc/resolv.conf
|
||||
fi
|
@ -74,6 +74,10 @@ mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||
cp xenstore-watch $RPM_BUILD_ROOT/usr/bin
|
||||
mkdir -p $RPM_BUILD_ROOT/etc
|
||||
cp serial.conf $RPM_BUILD_ROOT/var/lib/qubes/
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
|
||||
cp qubes_network.rules $RPM_BUILD_ROOT/etc/udev/rules.d/
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
|
||||
%triggerin -- initscripts
|
||||
cp /var/lib/qubes/serial.conf /etc/init/serial.conf
|
||||
@ -220,3 +224,5 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/etc/pki/rpm-gpg/RPM-GPG-KEY-qubes*
|
||||
/sbin/qubes_serial_login
|
||||
/usr/bin/xenstore-watch
|
||||
/etc/udev/rules.d/qubes_network.rules
|
||||
/usr/lib/qubes/setup_ip
|
||||
|
Loading…
Reference in New Issue
Block a user