#define DEFAULT_HOST_ADDR "192.168.33.1"
#define DEFAULT_GUEST_ADDR "192.168.33.15"
#define DEFAULT_GUEST_MAC "00:15:15:15:15:15"
+#define DEFAULT_HOST_MAC "00:01:01:01:01:01"
#define DEFAULT_SCRIPT "none"
#define MB_SHIFT (20)
static const char *host_ip_addr;
static const char *guest_ip;
static const char *guest_mac;
+static const char *host_mac;
static const char *script;
static const char *guest_name;
static bool single_step;
"Assign this address to the host side networking"),
OPT_STRING('\0', "guest-ip", &guest_ip, "a.b.c.d",
"Assign this address to the guest side networking"),
+ OPT_STRING('\0', "host-mac", &host_mac, "aa:bb:cc:dd:ee:ff",
+ "Assign this address to the host side NIC"),
OPT_STRING('\0', "guest-mac", &guest_mac, "aa:bb:cc:dd:ee:ff",
"Assign this address to the guest side NIC"),
OPT_STRING('\0', "tapscript", &script, "Script path",
if (!guest_mac)
guest_mac = DEFAULT_GUEST_MAC;
+ if (!host_mac)
+ host_mac = DEFAULT_HOST_MAC;
+
if (!script)
script = DEFAULT_SCRIPT;
net_params.guest_mac+3,
net_params.guest_mac+4,
net_params.guest_mac+5);
+ sscanf(host_mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+ net_params.host_mac,
+ net_params.host_mac+1,
+ net_params.host_mac+2,
+ net_params.host_mac+3,
+ net_params.host_mac+4,
+ net_params.host_mac+5);
if (!strncmp(network, "user", 4))
net_params.mode = NET_MODE_USER;