Last active
July 4, 2024 07:39
-
-
Save razhangwei/d43531fa6484282d3cd51aaf21be7b90 to your computer and use it in GitHub Desktop.
ip tool #unix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arp = ip neigh | |
ifconfig = ip addr | |
route = ip route | |
netstat = ss | |
ip addr show name | |
# Create MacVLan | |
ip link add mac0 link ens18 type macvlan mode bridge | |
ip addr add 192.168.0.94/27 dev mac0 # it needs to be subnet of the original macvlan | |
ip link set mac0 up | |
# show various routes | |
ip route add 192.168.0.0/24 dev mac0 metric 100 | |
ip route add 192.168.0.0/24 dev ens18 metric 200 | |
ip route delete 192.168.0.0/24 dev ens18 metric 200 | |
# get specific route | |
ip route get 192.168.0.86 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment