Difference between revisions of "OpenSuse Leap 15 iproute2 basics"

From Notes_Wiki
(Created page with "<yambe:breadcrumb self="iproute2 basisc">OpenSuse_Leap_15_Network_configuration|Network configuration</yambe:breadcrumb> =OpenSuse Leap 15 iproute2 basics= There is also a fe...")
 
m
Line 1: Line 1:
<yambe:breadcrumb self="iproute2 basisc">OpenSuse_Leap_15_Network_configuration|Network configuration</yambe:breadcrumb>
<yambe:breadcrumb self="iproute2 basics">IP routing 2 configuration|IP routing 2 configuration</yambe:breadcrumb>
<yambe:breadcrumb self="iproute2 basics">OpenSuse_Leap_15_Network_configuration|Network configuration</yambe:breadcrumb>
=OpenSuse Leap 15 iproute2 basics=
=OpenSuse Leap 15 iproute2 basics=


Line 65: Line 66:
Refer:
Refer:
* http://xmodulo.com/linux-tcpip-networking-net-tools-iproute2.html
* http://xmodulo.com/linux-tcpip-networking-net-tools-iproute2.html
<yambe:breadcrumb self="iproute2 basics">IP routing 2 configuration|IP routing 2 configuration</yambe:breadcrumb>
<yambe:breadcrumb self="iproute2 basics">OpenSuse_Leap_15_Network_configuration|Network configuration</yambe:breadcrumb>

Revision as of 03:40, 27 January 2019

<yambe:breadcrumb self="iproute2 basics">IP routing 2 configuration|IP routing 2 configuration</yambe:breadcrumb> <yambe:breadcrumb self="iproute2 basics">OpenSuse_Leap_15_Network_configuration|Network configuration</yambe:breadcrumb>

OpenSuse Leap 15 iproute2 basics

There is also a few older articles on IP routing 2 configuration

In modern OS such as OpenSuse Leap 15, backward compatibility for older net-tools commands such as ifconfig, route, etc. has been removed. Hence it is necessary to use 'ip' commands for most of the network tasks.

Check current ip addresses

Instead of 'ifconfig' use:

ip addr show

to list all interfaces and all addresses assigned to various interfaces. Note that each interface can have multiple addresses (IPv4, IPv6) associated with it.


Assign ip address

To assign ip address instead of using 'ifconfig <dev> <address>/<netmask>' use:

ip addr add <address>/<netmask> dev <interface> 

For example, ip addr add 10.0.0.1/24 dev eth1

Use 'del' in place of 'add' to remove the address


See routing table

To see routing table instead of using 'route -n' use:

ip route show 


Set default gateway

To set default gateway instead of using 'route add default gw <gateway-ip> [<interface>]' use:

ip route add default via <gateway> dev <interface>

For example, ip route add default via 192.168.1.2 dev eth0


Add static route

To add static route instead of using 'route add -net <network>/<netmask> gw <gateway> [dev <interface>]' use:

ip route add <network>/<netmask> via <gateway> dev <interface>

For example, ip route add 172.16.32.0/24 via 192.168.1.1 dev eth0


See network state information

To see network state information instead of using 'netstat -l' use:

ss -l


See arp table

To see arp table instead of using 'arp -a -n' use:

ip neigh



Refer:


<yambe:breadcrumb self="iproute2 basics">IP routing 2 configuration|IP routing 2 configuration</yambe:breadcrumb> <yambe:breadcrumb self="iproute2 basics">OpenSuse_Leap_15_Network_configuration|Network configuration</yambe:breadcrumb>