Net-tools to iproute2: Difference between revisions
No edit summary |
m Text replacement - "<code>" to "{{code|" |
||
| Line 25: | Line 25: | ||
|} | |} | ||
Like networking commands on switches and routers, you do not need to write the full command name so long as the beginning of the command is uniquely identifiable. For example, | Like networking commands on switches and routers, you do not need to write the full command name so long as the beginning of the command is uniquely identifiable. For example, {{code|ip address</code> can be simplified to {{code|ip a</code> and {{code|ip route</code> can be simplified to {{code|ip r</code>. | ||
The | The {{code|ip address add $ip/$mask dev $interface</code> will add additional IP addresses to the device. If it already has an existing IP address, you will need to use {{code|ip address del $ip/$mask dev $interface</code> to remove it. | ||
Some other commands: | Some other commands: | ||
Revision as of 19:12, 24 February 2017
The following maps the deprecated network tools (ifconfig, route, netstat, etc) to the new ip command.
| Old | New |
|---|---|
| ifconfig | ip addr |
| ifconfig $interface [up|down] | ip link set dev $interface [up|down] |
| ifconfig $interface $ip netmask $netmask | ip addr add $ip/$mask dev $interface |
| route add default gw $gateway | ip route add default via $gateway |
| route add -net $net netmask $netmask gw $gateway | ip route add $net/$mask via $gateway |
| route -n | ip route |
Like networking commands on switches and routers, you do not need to write the full command name so long as the beginning of the command is uniquely identifiable. For example, {{code|ip address can be simplified to {{code|ip a and {{code|ip route can be simplified to {{code|ip r.
The {{code|ip address add $ip/$mask dev $interface will add additional IP addresses to the device. If it already has an existing IP address, you will need to use {{code|ip address del $ip/$mask dev $interface to remove it.
Some other commands: