Sam's Tech Blog

'You can check out any time you like, But you can never leave!'

2019-08-21

Linux - IP and GW

How to: set IP and GW from command line in Linux.

Linux - IP and GW

Note! The mask and the IP here are just examples.

ip addr add 123.123.123.123/24 dev vmbr1
ip route add default via 123.123.123.1

or older Debians

ifconfig vmbr1 123.123.123.123 netmask 255.255.255.0
route add default gw 123.123.123.1