Internet connection sharing - Redhat

This is a discussion on Internet connection sharing - Redhat ; hi soldiers any soldier... knows the internet connection sharing in RHEL 5 means i have RHEL5 with internet working with 2 nics.. i want to share this internet with another windowsxp xompuer through 2nd NIC any soldeir knows please...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Internet connection sharing

  1. Internet connection sharing

    hi soldiers

    any soldier... knows the internet connection sharing in RHEL 5

    means i have RHEL5 with internet working with 2 nics..

    i want to share this internet with another windowsxp xompuer through
    2nd NIC

    any soldeir knows please




  2. Re: Internet connection sharing

    varin312@gmail.com wrote:
    > hi soldiers
    >
    > any soldier... knows the internet connection sharing in RHEL 5
    >
    > means i have RHEL5 with internet working with 2 nics..
    >
    > i want to share this internet with another windowsxp xompuer through
    > 2nd NIC
    >
    > any soldeir knows please
    >
    >
    >

    Varin312,


    Example:

    * eth0: Internet
    * eth1: LAN

    Change if the devicenames are different.

    touch /usr/bin/firewall
    chmod +x /usr/bin/firewall

    chkconfig iptables on
    serivce iptables start

    #Put the rest of the text in the file /usr/bin/firewall

    # Activate forwarding in the kernel:
    echo 1 > /proc/sys/net/ipv4/ip_forward

    # Remove all current firewall configuration rules:
    iptables -F
    iptables -t nat -F
    iptables --delete-chain
    iptables --table nat --delete-chain

    # Block to begin all incoming, and forwarding traffic, accept outgoing
    traffic (set DEFAULT):
    iptables -P INPUT DROP
    iptables -P FORWARD DROP
    iptables -P OUTPUT ACCEPT

    # Block all traffic from/to connecties with invalid state:
    iptables -A INPUT -m state --state INVALID -j DROP
    iptables -A FORWARD -m state --state INVALID -j DROP
    iptables -A OUTPUT -m state --state INVALID -j DROP

    # Accept traffice from the router to the router itself:
    iptables -A INPUT -i lo -j ACCEPT
    iptables -A OUTPUT -o lo -j ACCEPT

    # Accept forward trafic in all directions:
    iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
    iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

    # Accept traffic from the LAN:
    iptables -A INPUT -i eth1 -j ACCEPT

    # except traffic from the Internet if you initalised the connection
    yourself:
    iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

    # Use IP masquerading that way the Internet just sees the router:
    iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE

    #Run the script:
    firewall


    This is a translation of:

    http://www.bartendavid.be/doc/howto/...r-install.html

    The authors also shows how to let your Apache server can be made
    available to Internetters:

    # Accept Apache traffic, in other words accept TCP traffic on port 80 by
    eth0:
    iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT


    Kind regards,


    Jan Gerrit Kootstra

+ Reply to Thread