2 nic on centos 5

Discussion in 'Server Operation' started by aaa999, Nov 23, 2007.

  1. aaa999

    aaa999 New Member

    Hi,

    I need guided ahnd for this one.

    2 nic on the centos, which will be as test web server you personal stuffs.

    nic 1 is 192.168.x internet
    eth0

    nic2 is 10.26.18.x local
    etho1.

    and they both static assinged.

    can anyone give the struction on how to make this work.

    on a 2003 server I have 4 nics and it easy to configure, but I'm new to linux.
    but on a windows NAT loaded.


    thanks.
     
  2. 40esp

    40esp New Member

    if you wish to make a "connection between the two, you need to setup NAT by using iptables (linux firewall)

    Run these commands to achieve NAT

    eth0 is internet eth1 is local

    Code:
    iptables --flush
    iptables --table nat --flush
    iptables --delete-chain
    iptables --table nat --delete-chain
    iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
    iptables --append FORWARD --in-interface eth1 -j ACCEPT
    echo 1 > /proc/sys/net/ipv4/ip_forward
    service iptables restart
     
  3. aaa999

    aaa999 New Member

    iptables

    Hi 40esp,

    trying to run the commands, got bad command or not found,
    how do you start the iptables those.

    thanks.

    newbie to linux, but I like it for a server side.

    thanks.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Please install iptables like this:
    Code:
    yum install iptables
     

Share This Page