| Revision 2488,
1.2 KB
checked in by kcr@…, 3 years ago
(diff) |
|
refactor variables
|
| Line | |
|---|
| 1 | In /etc/network/interfaces |
|---|
| 2 | |
|---|
| 3 | auto tap0 |
|---|
| 4 | iface tap0 inet static |
|---|
| 5 | address 192.0.2.1 |
|---|
| 6 | netmask 255.255.255.0 |
|---|
| 7 | vde2-switch - |
|---|
| 8 | post-up sysctl -w net.ipv4.ip_forward=1 |
|---|
| 9 | post-up iptables -t nat -A POSTROUTING -s 192.0.2.0/255.255.255.0 -j MASQUERADE |
|---|
| 10 | post-up /etc/init.d/dhcp3-server start |
|---|
| 11 | pre-down /etc/init.d/dhcp3-server stop |
|---|
| 12 | pre-down iptables -t nat -D POSTROUTING -s 192.0.2.0/255.255.255.0 -j MASQUERADE |
|---|
| 13 | pre-down sysctl -w net.ipv4.ip_forward=0 |
|---|
| 14 | |
|---|
| 15 | Run qemu as e.g. |
|---|
| 16 | vdeq qemu -m 512 -net nic,vlan=1,macaddr=02:00:00:00:00:00 -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl -hda master.img |
|---|
| 17 | |
|---|
| 18 | for pxe booting in lenny, install kvm and cd /usr/share/qemu; ln -s ../kvm/pxe* . |
|---|
| 19 | |
|---|
| 20 | add yourself to the vde2-net group |
|---|
| 21 | -- |
|---|
| 22 | apt-get install -y dhcp3-server tftpd bind9 |
|---|
| 23 | |
|---|
| 24 | http://debian.lcs.mit.edu/debian/dists/lenny/main/installer-i386/current/images/netboot/netboot.tar.gz |
|---|
| 25 | |
|---|
| 26 | /etc/bind/named.conf.options: |
|---|
| 27 | allow-query { 127.0.0.1; 192.0.2.0/24; }; |
|---|
| 28 | |
|---|
| 29 | /etc/default/dhcp3-server: |
|---|
| 30 | INTERFACES="tap0" |
|---|
| 31 | |
|---|
| 32 | ln -s $(realpath tftpboot) /tftpboot |
|---|
| 33 | ln -s $(realpath preseed.cfg) /var/www |
|---|
| 34 | -- install |
|---|
| 35 | sudo -u kcr vdeq kvm -m 128 -net nic,vlan=1,macaddr=02:00:00:00:00:00 -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl -hda test.img -boot n -nographic |
|---|
Note: See
TracBrowser
for help on using the repository browser.