Article View: comp.os.linux.networking
Article #391Re: how to set up a 192.168.xxx.xxx network next to existing network
From: Pieppo
Date: Wed, 29 May 2002 12:43
Date: Wed, 29 May 2002 12:43
52 lines
2899 bytes
2899 bytes
>> The thing is very simple.. do not try to complicate it too much :)
>> 1) On your gateway you should have two interfaces: one with address in your
>> old subnet, the other with address in your new address, e.g. 192.168.0.1
>> mask 255.255.0.0.
>
>Where do I add the information for the second interface? On my linux
>machine, do I simply add another gateway entry in the
>/etc/sysconfig/network file by adding a line:
>
>GATEWAY=192.168.0.1
You don't need a new default gateway on the gateway itself.
Keep the old one (gateway related to the old subnet).
The "GATEWAY=192.168.0.1" should appear only on the
machines in the new subnet 192.168.x.x
>> 2) define a NAT (masquarade) on the 192.168 network - you have to do that
>> since 192.168 netwok can not be seen from the internet
>
>Can someone tell me where to add the requisite information under linux
>to define a NAT? I am using IP tables and I have a firewall script. I
>think I may have to put a line in my firewall script, something like:
>
You need something like:
iptables -t nat -A POSTROUTING -o $YOUR_EXTERNAL_INTERFACE -j SNAT
--to-source $YOUR_EXTERNAL_IP
and the control what you want to forward with the
FORWARD chain.
>Would this both forward as well as masquerade to 192.168.0.0/24?
>
>> 3) enable IP forwarding
>
>Hopefully the above line takes care of that? Can someone correct that
>line if it is wrong?
>
No. You have to tell it to the kernel with
echo '1' > /proc/sys/net/ipv4/ip_forward
Take a look at the HOWTOS in http://www.netfilter.org
Bye
Pietro
Technical Details
Message-ID:
<slrnaf9g5h.107.Pieppo@fellini.dm.unibo.it>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsbo.news.garr.it!NewsITBone-GARR!newsfeed.cineca.it!PieppoReferences:
<3CF4400C.D16FE45C@fractalgraphics.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10669a,5a9a9edbaac586f3 X-Google-Attributes: gid10669a,public X-Google-Thread: 105af6,5a9a9edbaac586f3 X-Google-Attributes: gid105af6,public X-Google-Thread: f4ee5,5a9a9edbaac586f3 X-Google-Attributes: gidf4ee5,public X-Google-Thread: 108a34,5a9a9edbaac586f3 X-Google-Attributes: gid108a34,public X-Google-ArrivalTime: 2002-05-29 05:50:13 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsbo.news.garr.it!NewsITBone-GARR!newsfeed.cineca.it!Pieppo From: Pieppo@fellini.dm.unibo.it (Pieppo) Newsgroups: comp.os.linux.networking,be.comp.networking,comp.os.ms-windows.networking.misc,microsoft.public.win98.networking Subject: Re: how to set up a 192.168.xxx.xxx network next to existing network Date: Wed, 29 May 2002 12:43:40 +0000 (UTC) Organization: CINECA Lines: 52 Message-ID: <slrnaf9g5h.107.Pieppo@fellini.dm.unibo.it> References: <3CF4400C.D16FE45C@fractalgraphics.com.au> Reply-To: donapieppo@yahoo.it NNTP-Posting-Host: fellini.dm.unibo.it X-Trace: newsfeed.cineca.it 1022676220 18549 137.204.134.30 (29 May 2002 12:43:40 GMT) X-Complaints-To: news@cineca.it NNTP-Posting-Date: Wed, 29 May 2002 12:43:40 +0000 (UTC) User-Agent: slrn/0.9.6.4 (Linux)