VirtualBox
$ sudo apt-get install bridge-utils
Creat vboxnet0:
$ VBoxManage hostonlyif create
$ ifconfig
Using host networking and NAT with VirtualBox
apt-get install bridge-utils
Add the following to /etc/network/interfaces:
# VirtualBox NAT bridge auto vnet0 iface vnet0 inet static address 172.16.0.1 netmask 255.255.255.0 bridge_ports none bridge_maxwait 0 bridge_fd 1 up iptables -t nat -I POSTROUTING -s 172.16.0.0/24 -j MASQUERADE down iptables -t nat -D POSTROUTING -s 172.16.0.0/24 -j MASQUERADE
Either reboot or start it manually:
ifup vnet0
Find the ‘net.ipv4.ip_forward’ line in /etc/sysctl.conf, and uncomment it:
# Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.ip_forward=1
And load it:
sysctl -p
apt-get install dnsmasq
And edit /etc/dnsmasq.conf to include:
interface=vnet0 dhcp-range=172.16.0.2,172.16.0.254,1h
That’s all you really need, but you may want to explicitly define DNS servers and domains for the guests, or static assignments. Add:
dhcp-option=option:dns-server,172.16.0.1,208.67.222.222,208.67.220.220 dhcp-option=option:domain-name,example.com dhcp-host=08:00:27:00:00:02,vmxp,172.16.0.2 # Windows XP dhcp-host=08:00:27:00:00:03,vmubuntu,172.16.0.3 # Ubuntu
barnix2@barnix2-945GCM-S2C:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:1a:4d:fb:85:7a
inet addr:192.168.2.100 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::21a:4dff:fefb:857a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:73 errors:0 dropped:0 overruns:0 frame:0
TX packets:184 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:45120 (45.1 KB) TX bytes:26123 (26.1 KB)
Interrupt:43 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:48 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4328 (4.3 KB) TX bytes:4328 (4.3 KB)
vboxnet0 Link encap:Ethernet HWaddr 0a:00:27:00:00:00
inet addr:192.168.56.1 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:141 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:24766 (24.7 KB)
vnet0 Link encap:Ethernet HWaddr de:77:ec:99:80:d5
inet addr:172.16.0.1 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::dc77:ecff:fe99:80d5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:178 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:26096 (26.0 KB)
Bridged Adapter eth0
MQL5 script for saving the ticks in Mysql_winxp:
Accessing a Mysql_winxp server running on WinXP:
Enable MySql_linux server for remote access
1.
$mysql
grant all privileges on *.* to remoteuser@123.123.123.123 identified by "userpassword";
flush privileges;
2.
nano /etc/mysql/my.cnf
By default MySQL only listens to localhost. You will need to comment out the bind-address line in your mysqlconfiguration file:
3.
/etc/init.d/mysql restart