File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,14 +57,27 @@ ip tuntap add dev tap0 mode tap
5757echo " [*] Bringing tap0 up"
5858ip link set tap0 up
5959
60- echo " [*] Setting MTU to 1400 on tap0"
61- ip link set dev tap0 mtu 1400
60+ # ---------------------------
61+ # Generate random MAC (02:xx:xx:xx:xx:xx)
62+ # ---------------------------
63+ mac=$( printf " 02:%02x:%02x:%02x:%02x:%02x" \
64+ $(( RANDOM& 0xFF )) \
65+ $(( RANDOM& 0xFF )) \
66+ $(( RANDOM& 0xFF )) \
67+ $(( RANDOM& 0xFF )) \
68+ $(( RANDOM& 0xFF )) )
69+
70+ echo " [*] Assigning random MAC = $mac "
71+ ip link set dev tap0 address " $mac "
6272
73+ # ---------------------------
74+ # Assign IP
75+ # ---------------------------
6376echo " [*] Assigning IP $IP /24"
6477ip addr add " $IP /24" dev tap0
6578
6679echo
6780echo " === DONE ==="
6881ip addr show tap0
6982echo
70- echo " You can now run vportd with: sudo ./vportd <server_ip> <server_port> tap0"
83+ echo " You can now run vportd with: sudo ./vportd <server_ip> <server_port> tap0"
You can’t perform that action at this time.
0 commit comments