mirror of
https://github.com/cheat/cheat.git
synced 2024-12-19 03:05:06 +01:00
Merge pull request #174 from juliushaertl/master
Add cheat for iproute2
This commit is contained in:
commit
3e287e62b8
32
cheat/cheatsheets/ip
Normal file
32
cheat/cheatsheets/ip
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Display all interfaces with addresses
|
||||||
|
ip addr
|
||||||
|
|
||||||
|
# Take down / up the wireless adapter
|
||||||
|
ip link set dev wlan0 {up|down}
|
||||||
|
|
||||||
|
# Set a static IP and netmask
|
||||||
|
ip addr add 192.168.1.100/32 dev eth0
|
||||||
|
|
||||||
|
# Remove a IP from an interface
|
||||||
|
ip addr del 192.168.1.100/32 dev eth0
|
||||||
|
|
||||||
|
# Remove all IPs from an interface
|
||||||
|
ip address flush dev eth0
|
||||||
|
|
||||||
|
# Display all routes
|
||||||
|
ip route
|
||||||
|
|
||||||
|
# Display all routes for IPv6
|
||||||
|
ip -6 route
|
||||||
|
|
||||||
|
# Add route via gateway IP
|
||||||
|
ip route add 192.168.0.0/24 via 192.168.1.1
|
||||||
|
|
||||||
|
# Add route via interface
|
||||||
|
ip route add 192.168.0.0/24 dev eth0
|
||||||
|
|
||||||
|
# Change your mac address
|
||||||
|
ip link set dev eth0 address aa:bb:cc:dd:ee:ff
|
||||||
|
|
||||||
|
# View neighbors (using ARP and NDP)
|
||||||
|
ip neighbor show
|
Loading…
Reference in New Issue
Block a user