Best method for both local and remote access to web server?

Discussion in 'Installation/Configuration' started by Eviang, Sep 18, 2010.

  1. Eviang

    Eviang New Member

    Hi all,

    I have a Linux Server that I've managed to setup using the CentOS perfect guide. It has two NICs each one with a public static IP address but it's outside my network and when I'm developing a web site, I have lots of waiting times each time a file is compared, uploaded or downloaded.

    Is there any way of "sharing" the server between my LAN using one NIC and the outside world using the second NIC?

    For example, tell my FTP program to connect to http://192.168.0.100 (LAN address) but have the possibility to see the websites from the outside using either an IP address or domain name?

    I've done it before with Windows Servers and I think it's very doable with Linux... just don't know how.

    BTW all my sites are backed up so I don't mind formatting and installing the server all over again.

    Thanks!
     
  2. Boogey

    Boogey New Member

    Hi

    You can do this by configure your network interfaces manually without a gateway on the lan interface. I am no centos expert but it must be something like this.

    1. Set up WAN NIC.
    edit /etc/sysconfig/network-scripts/ifcfg-eth0
    should looks like:

    DEVICE=eth0
    ONBOOT=yes
    BOOTPROTO=static
    IPADDR=aa.aa.aa.aa # e.g. 123.45.67.89
    NETMASK=bb.bb.bb.bb # e.g. 255.255.255.0
    GATEWAY=ee.ee.ee.ee # e.g. 123.45.67.1
    TYPE=Ethernet


    Set up LAN NIC. This step requires operations similar to previous step.

    Edit /etc/sysconfig/network-scripts/ifcfg-eth1 and make sure that it looks like:

    DEVICE=eth1
    ONBOOT=yes
    BOOTPROTO=static
    IPADDR=cc.cc.cc.cc # e.g. 192.168.0.100
    NETMASK=dd.dd.dd.dd # e.g. 255.255.255.0
    NETWORK=192.168.0.0
    BROADCAST=192.168.0.255
    TYPE=Ethernet

    Afterwards you have to restart the network:

    /etc/init.d/network restart

    check your config
    ifconfig
     
    Last edited: Sep 20, 2010

Share This Page