The ip command is used to display or configure networking and to assign an address to a network interface on Linux operating systems. It replaces the ifconfig command now deprecated.
ip a
or
ip addr
to specify one interface :
ip a show eth0
ip a add {ip/mask} dev {interface}
example, assign 192.168.1.10 to eth0 :
ip a add 192.168.1.10/255.255.255.0 dev eth0
or
ip a add 192.168.1.10/24 dev eth0
ip link set dev eth0 down
ip link set dev eth0 up
The maximum transmission unit (MTU) defines the largest payload size of a packet that can be transmitted. The default value is set at 1500 bytes. Nevertheless, it is possible to allow for the transmission of more data and improve transfer rates by adjusting the MTU to 9000, which facilitates the utilization of Jumbo Frames.
ip link set mtu 9000 dev eth0
netstat -rn
or
ip r
ip route
ip route add {NETWORK/MASK} via {GATEWAYIP}
Add a plain route to network 192.168.1.0/255.255.255.0 via gateway 192.168.1.1:
ip route add 192.168.1.0/255.255.255.0 via 192.168.1.1
To route all traffic via 192.168.1.1 gateway on eth0 network interface :
ip route add 192.168.1.0/255.255.255.0 dev eth0
or
ip route add 192.168.1.0/24 via 192.168.1.1
ip route del 192.168.1.0/255.255.255.0 dev eth0
ip link set dev eth0 down
ip link set dev eth0 address aa:bb:cc:dd:ee:ff
ip link set dev eth0 up
when using macchanger, the single command is :
macchanger -m aa:bb:cc:dd:ee:ff eth0