| 79 | |
| 80 | 重新啟動tftp,dhcp |
| 81 | {{{ |
| 82 | sudo /etc/init.d/dhcp3-server start |
| 83 | sudo /etc/init.d/tftpd-hpa start |
| 84 | }}} |
| 85 | |
| 86 | 啟動NA讓tap0上的封包轉發到eth0 |
| 87 | {{{ |
| 88 | sudo bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' |
| 89 | iptables -F |
| 90 | iptables -X |
| 91 | iptables -t nat -F |
| 92 | iptables -t nat -X |
| 93 | iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT |
| 94 | iptables -t nat -A POSTROUTING -o eth0 -s 10.0.0.0/24 -j MASQUERADE |
| 95 | iptables -L |
| 96 | }}} |
| 97 | |
| 98 | 利用qemu指令作網路開機 |
| 99 | {{{ |
| 100 | qemu -boot n -option-rom /usr/share/qemu/pxe-ne2k_pci.bin -m 512 -net nic -net tap,ifname=tap0,script=no |
| 101 | }}} |