Pages

Network Configuration using IP command

To display IP Address

# ip address show

Note :- sit0: A special virtual device which can be used to encapsulate IPv4 packets into IPv6 packets.It is not used in a normal IPv4 network




To Display Device Attributes

# ip link show

Below mentioned are the list of possible attributes and their meanings.



UP : The device is turned on.It is ready to trasmit packets to and receive packets from the network
LOOPBACK  : The device is a loopback device.
BROADCAST : The device can send packets to all hosts sharing the same network
POINTOPOINT  : The device is connected only to one other device.All packets are sent to and received from the other device
MULTICAST  :   The device can send packets to a group of other systems at the same time
PROMISC  : The device listens to all packets on the network, not only to those sent to the device hardware addreess. This is usually used for network monitoring.

Device Statistics

# ip -s link show eth0

The section starting with RX displays information about received packets, and the section starting with TX displays information about sent packets

Assign an IP address to a Device

# ip address add 10.0.0.2/24 brd + dev eth0

Delete the IP address from a Device

# ip address del 10.0.0.2/24 dev eth0

Change Device Attributes

To enable a network device

# ip link set eth0 up

To disable a network device

# ip link set eth0 down




View the Routing table

# ip route show

Set a Route to the Locally connected Network

# ip route add 10.0.0.0/24 dev eth0

Set a Route to a Different network

# ip route ass 192.168.1.0/24 via 10.0.0.100

Set a Default Route

# ip route add default via 10.0.0.254

Delete Routes from the Routing table

# ip route delete 192.168.1.0/24 dev eth0




1 comment: