Software >> OS >> Unix >> Linux >> Debian >> How to configure static or dynamic IP on network interfaces
|
/etc/network/interfaces |
# This file describes the network interfaces available on your system |
## The statement auto means that the interfaces will be brough up when ifup -a is executed
## e.g. the networking service is started.
## Other options for static
## address [address]
## netmask [mask]
## broadcast [broadcast_address]
## metric [metric] (Routing metric for default gateway, integer value)
## gateway [address] (Default gateway)
## pointopoint [address] (Address of other end point)
## hwaddress [macaddress|random]
## mtu [size]
## scope [global|link] (Address validity scope)
## restart the networking service
systemctl restart networking
## Example 2, configure some interface in /etc/network/interfaces
## and some in individual interface files in /etc/network/interfaces.d/
vi /etc/network/interfaces
/etc/network/interfaces |
# This file describes the network interfaces available on your system |
vi /etc/network/interfaces.d/enp0s8
/etc/network/interfaces.d/enp0s8 |
auto enp0s8 |
vi /etc/network/interfaces.d/enp0s9
/etc/network/interfaces.d/enp0s9 |
auto enp0s9 |
systemctl restart networking