> For the complete documentation index, see [llms.txt](https://fashaun.gitbook.io/linux-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fashaun.gitbook.io/linux-network/network_monitor.md).

# network monitor

net-tools (Stop maintain)

* procfs
* ioctl

iproute2

* netlink

Show all interface state

* ifconfig -a
* ip li sh

Enable/Disable interface link

* sudo ifconfig $interface\_name up/down
* sudo ip link set up/down $interface\_name

Assign ip address //iproute2 could give one more address to a link (ifconfig need to give alias)

* sudo ifconfig $interface\_name $ipaddr\_with\_mask
* sudo ip addr add $ipaddr\_with\_mask dev $interface\_name

alias ip 1. sudo vconfig add $interface\_name $vlan 2. sudo ifconfig $interface\_name.$vlan:1 $ip1 3. sudo ifconfig $interface\_name.$vlan:2 $ip2

Remove ip address

* sudo ifconfig $interface\_name 0
* sudo ip addr del $ip\_addr dev $interface\_name

Show interface ip address

* ifconfig $interface\_name (Show only one address)
* ip addr show dev $interface\_name

Show ipv6 address

* ifconfig $interface\_name (Show only one address)
* ip -6 addr show dev $interface\_name

Assign ipv6 address

* sudo ifconfig $interface\_name inet6 add $ipv6\_addr\_with\_mask
* sudo ip -6 addr add $ipv6\_addr\_mask dev $interface\_name

Remove ipv6 address

* sudo ifconfig $interface\_name inet6 del $ipv6\_addr\_with\_mask
* sudo ip -6 addr del $ipv6\_addr\_with\_mask dev $interface\_name

Modify MAC address

* sudo ifconfig $interface\_name hw ether $MAC
* sudo ip link set dev $interface\_name address $MAC

List Routing Table

* route -an (netstat -rn)
* ip ro sh (ip route show)

Add and modify default route

* sudo route add default gw $gw\_ip $interface\_name $ sudo route del default gw $gw\_ip $interface\_name
* sudo ip route add default via $gw\_ip dev $interface\_name $ sudo ip route replace default via $gw\_ip dev $interface\_name

Add and remove static route

* sudo route add -net 172.16.32.0/24 gw 192.168.1.1 dev eth0 $ sudo route del -net 172.16.32.0/24
* sudo ip route add 172.16.32.0/24 via 192.168.1.1 dev eth0 $ sudo ip route del 172.16.32.0/24

Check network state

* netstate
* ss -l

List ARP table

* arp -an
* ip neigh

Add static arp

* sudo arp -s 192.168.1.100 00:0c:29:c0:5a:ef $ sudo arp -d 192.168.1.100
* sudo ip neigh add 192.168.1.100 lladdr 00:0c:29:c0:5a:ef dev eth0 $ sudo ip neigh del 192.168.1.100 dev eth0


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fashaun.gitbook.io/linux-network/network_monitor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
