PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:server:linux:networking-with-linux:networking-with-linux

Networking with Linux

New Generation

show IP addresses

ip address show
ip a s
ip a

show routing table

ip route show
ip r s
ip r

On the fly

TODO

sudo ip addr add 172.16.1.5/24 dev eth1
sudo ip route del 0.0.0.0/0
sudo ip route add 0.0.0.0/0 via 172.16.1.5

Link up/down

sudo ip link set enp1s0f0 up
sudo ip link set enp1s0f0 down

Traditional

show IP addresses

ifconfig

show routing table

route

On the fly

ifconfig eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255
route add default gw 192.168.0.254 eth0
ifconfig eth1 up 10.0.0.10 netmask 255.255.255.252
route add -net 10.0.0.0/16 gw 10.0.0.9 dev eth1
route add -net 192.168.0.0/29 gw 10.0.0.9 dev eth1
tech/server/linux/networking-with-linux/networking-with-linux.txt · Last modified: 2020/10/30 19:38 by wnoguchi