[Network] Setup network interface in Linux ubuntu

/etc/network/interfaces
Example interface for static,

auto ens32
iface ens32 inet static
    address 192.168.96.91
    netmask 255.255.255.0
    network 192.168.96.0
    broadcast 192.168.96.255
    gateway 192.168.96.1

Example interface for dhcp

auto eth0
iface eth0 inet dhcp

Setup ipv4 routing table

iface ens33 inet static
    address 20.10.0.11
    netmask 255.255.255.0
    broadcast 20.10.0.255

    up route add -net 20.20.0.0 netmask 255.255.255.0 gw 20.10.0.12
    up route add -net 20.30.0.0 netmask 255.255.255.0 gw 20.10.0.12
    up route add -net 20.40.0.0 netmask 255.255.255.0 gw 20.10.0.12

Setup ipv6 routing table

iface ens33 inet6 static
    address 2001:20:10::11
    netmask 64

    up route -A inet6 add 2001:20:20::0/64 gw 2001:20:10::12
    up route -A inet6 add 2001:20:30::0/64 gw 2001:20:10::12
    up route -A inet6 add 2001:20:40::0/64 gw 2001:20:10::12
0
0 Comments
Inline Feedbacks
View all comments