Loading ...
Sorry, an error occurred while loading the content.
 

Re: [LINUX_Newbies] linux gateway

Expand Messages
  • Mike Peters
    On Tue, 4 Mar 2003 00:10:16 +0200 ... ^^^^^^^^^ Should of course be $IPTABLES Sorry. -- Mike Registered Linux User #247123 It was all very well going about
    Message 1 of 6 , Mar 3, 2003
      On Tue, 4 Mar 2003 00:10:16 +0200
      Mike Peters <mpeters@...> wrote:

      >
      > $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state \
      > ESTABLISHED,RELATED -j ACCEPT
      > $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
      > $IPTABLES -A FORWARD -j DROP
      > #IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP
      ^^^^^^^^^
      Should of course be $IPTABLES

      Sorry.
      --
      Mike

      Registered Linux User #247123

      It was all very well going about pure logic and how the universe was
      ruled by logic and the harmony of numbers, but the plain fact was that
      the disc was manifestly traversing space on the back of a giant turtle
      and the gods had a habit of going round to atheists' houses and smashing
      their windows.
      (Colour of Magic)
    • Dr. Dinesh Mhatre
      Hi Yes my both cards show up in ifconfig i can also ping to the windows machine Where do i put this script and run it? ... From: Mike Peters
      Message 2 of 6 , Mar 4, 2003
        Hi
        Yes my both cards show up in ifconfig
        i can also ping to the windows machine

        Where do i put this script and run it?
        ----- Original Message -----
        From: "Mike Peters" <mpeters@...>
        To: <LINUX_Newbies@yahoogroups.com>
        Sent: Tuesday, March 04, 2003 3:40 AM
        Subject: Re: [LINUX_Newbies] linux gateway


        > On Mon, 3 Mar 2003 21:18:16 +0530
        > "Dr. Dinesh Mhatre" <hightechflav@...> wrote:
        >
        > > i have one pc with 2 nic running linux and also having access to net
        > > through 1 nic. The other pc has 1 nic and running windows. How do i
        > > access net on windows pc using crossover cable
        > >
        > >
        >
        > Are the 2 nics configured in linux, ie do they both show up when you run
        > ifconfig for example? If so you just need to enable ip masquerading in
        > your firewall (see below) on the linux machine and set the gateway of
        > the windows machine to the ip address of the linux machine.
        >
        > Your firewall script add:
        >
        > #To enable forwarding:
        > echo "1" > /proc/sys/net/ipv4/ip_forward
        >
        > #If you use a dynamic ip:
        > echo "1" > /proc/sys/net/ipv4/ip_dynaddr
        >
        > #ip masq stuff (replace with real values):
        > IPTABLES=/path/to/iptables
        > EXTIF=external interface
        > INTIF=internal interface
        > INTIP=internal ip
        > EXTIP=external ip
        >
        > $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state \
        > ESTABLISHED,RELATED -j ACCEPT
        > $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
        > $IPTABLES -A FORWARD -j DROP
        > #IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP
        >
        > Also check you have the appropriate kernel modules loaded before you run
        > this.
        >
        > The windows stuff is done with one of those fangled GUI things :)
        > --
        > Mike
        >
        > Registered Linux User #247123
        >
        > It was all very well going about pure logic and how the universe was
        > ruled by logic and the harmony of numbers, but the plain fact was that
        > the disc was manifestly traversing space on the back of a giant turtle
        > and the gods had a habit of going round to atheists' houses and smashing
        > their windows.
        > (Colour of Magic)
        >
        >
        > To unsubscribe from this list, please email
        LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
        >
        >
      • Dr. Dinesh Mhatre
        Hi Yes my both cards show up in ifconfig i can also ping to the windows machine Where do i put this script and run it? -- Original Message ----- ...
        Message 3 of 6 , Mar 4, 2003
          Hi
          Yes my both cards show up in ifconfig
          i can also ping to the windows machine
          Where do i put this script and run it?


          -- Original Message -----
          > From: "Mike Peters" <mpeters@...>
          > To: <LINUX_Newbies@yahoogroups.com>
          > Sent: Tuesday, March 04, 2003 3:40 AM
          > Subject: Re: [LINUX_Newbies] linux gateway
          >
          >
          > > On Mon, 3 Mar 2003 21:18:16 +0530
          > > "Dr. Dinesh Mhatre" <hightechflav@...> wrote:
          > >
          > > > i have one pc with 2 nic running linux and also having access to net
          > > > through 1 nic. The other pc has 1 nic and running windows. How do i
          > > > access net on windows pc using crossover cable
          > > >
          > > >
          > >
          > > Are the 2 nics configured in linux, ie do they both show up when you run
          > > ifconfig for example? If so you just need to enable ip masquerading in
          > > your firewall (see below) on the linux machine and set the gateway of
          > > the windows machine to the ip address of the linux machine.
          > >
          > > Your firewall script add:
          > >
          > > #To enable forwarding:
          > > echo "1" > /proc/sys/net/ipv4/ip_forward
          > >
          > > #If you use a dynamic ip:
          > > echo "1" > /proc/sys/net/ipv4/ip_dynaddr
          > >
          > > #ip masq stuff (replace with real values):
          > > IPTABLES=/path/to/iptables
          > > EXTIF=external interface
          > > INTIF=internal interface
          > > INTIP=internal ip
          > > EXTIP=external ip
          > >
          > > $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state \
          > > ESTABLISHED,RELATED -j ACCEPT
          > > $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
          > > $IPTABLES -A FORWARD -j DROP
          > > #IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP
          > >
          > > Also check you have the appropriate kernel modules loaded before you run
          > > this.
          > >
          > > The windows stuff is done with one of those fangled GUI things :)
          > > --
          > > Mike
          > >
          > > Registered Linux User #247123
          > >
          > > It was all very well going about pure logic and how the universe was
          > > ruled by logic and the harmony of numbers, but the plain fact was that
          > > the disc was manifestly traversing space on the back of a giant turtle
          > > and the gods had a habit of going round to atheists' houses and smashing
          > > their windows.
          > > (Colour of Magic)
          > >
          > >
          > > To unsubscribe from this list, please email
          > LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.
          > >
          > > Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
          > >
          > >
          > >
          > >
          >
        • Mike Peters
          On Tue, 4 Mar 2003 20:51:09 +0530 ... You don t say what distro you re running (or I missed it) but it should go somewhere that s going to get run at boot
          Message 4 of 6 , Mar 4, 2003
            On Tue, 4 Mar 2003 20:51:09 +0530
            "Dr. Dinesh Mhatre" <hightechflav@...> wrote:

            > Hi
            > Yes my both cards show up in ifconfig
            > i can also ping to the windows machine
            >
            > Where do i put this script and run it?

            You don't say what distro you're running (or I missed it) but it should
            go somewhere that's going to get run at boot anywhere after the your
            network is fired up. Look for something like rc.firewall. Where exactly
            the best place is depends on your distro. You could even type it out at
            a command prompt but that may get a bit tedious ;).

            --
            Mike

            Registered Linux User #247123

            He glanced cautiously at the dancing shapes, which made weird and
            worrying shapes on the far wall - strange biped animals, eldritch
            underground things...
            Carrot sighed.
            'Stop making shadow pictures, Detritus.'
            (Men at Arms)
          Your message has been successfully submitted and would be delivered to recipients shortly.