Public static IP configuration Ubuntu Server 14.04 LTS

Discussion in 'Installation/Configuration' started by Poliman, Feb 2, 2017.

  1. Poliman

    Poliman Member

    Hello everyone. I have a problem with configuration public static IP on my Ubuntu Server. I don't know what is wrong. I have 4 network interfaces from em1 to em4. I have connected em1 to LAN and em4 to WAN. Here is configuration in /etc/network/interfaces:
    # The primary network interface
    auto em1 em4
    iface em1 inet static
    address 192.168.100.202
    network 192.168.100.0
    netmask 255.255.255.0
    broadcast 192.168.100.255
    #gateway 192.168.100.2 #this is not needed if below is configured gateway, am I right?
    dns-nameservers 192.168.100.2

    iface em4 inet static
    address 31.X.X.180
    network 31.X.X.176 #calculated from netmask and address
    netmask 255.255.255.248
    gateway 31.X.X.177
    dns-nameservers 193.X.X.10 193.X.X.20

    Should I add some static routes or something? With this configuration I can't connect to the server from outside. Command 'route -n' in console gives output:
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.100.2 0.0.0.0 UG 0 0 0 em1
    31.X.X.176 0.0.0.0 255.255.255.248 U 0 0 0 em4
    192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
     

Share This Page