Skip to content

Instantly share code, notes, and snippets.

@chreniuc
Created June 4, 2019 18:26
Show Gist options
  • Save chreniuc/68b4e8fdae58133cb43f202f7bbd7bcf to your computer and use it in GitHub Desktop.
Save chreniuc/68b4e8fdae58133cb43f202f7bbd7bcf to your computer and use it in GitHub Desktop.
Public and private ip on the same interface, debian
# Restart the networking daemon:
# systemctl restart networking
# Shutdown an interface: ifdown eth0
# Enable an interface: ifup eth0
# The loopback network interface (localhost)
# Localhost
auto lo
iface lo inet loopback
# The primary network interface (private)
auto eth0
iface eth0 inet dhcp
name private-route
# name is optional
# The secondary network interface (Private)
# auto eth1
# iface eth1 inet dhcp
# The primary network interface (public)
auto eth0:pub0
iface eth0:pub0 inet static
name public-route
address 50.114.228.24
netmask 255.255.255.255
# gateway 192.168.0.1
# dns-nameservers 8.8.8.8 1.1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment