Skip to content

/etc/network/interfaces Ubuntu Static Network setup

/etc/network/interfaces Ubuntu Static Network setup

Following example setup eth0 with 192.168.1.1 IP address and gateway (router) to 192.168.1.2

iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.2

With IPtables

auto eth0
iface eth0 inet dhcp
pre-up iptables-restore < /etc/iptables.rules
post-down iptables-restore < /etc/iptables.downrules

Another Example -

auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0

Post a Comment

You must be logged in to post a comment.