🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.linux.networking
4 messages
4 total messages Started by hugo Wed, 29 May 2002 02:42
how to set up a 192.168.xxx.xxx network next to existing network
#389
Author: hugo
Date: Wed, 29 May 2002 02:42
81 lines
3937 bytes
Hi 

I received a useful reply on how to set up a 192.168.xxx.xxx network
next to my existing one, but I am still not quite sure on how to
implement the changes. Aor my gateway and router I am running linux 6.2
(kernel 2.4.2-2) with iptables-1.2.1a-1 and iproute-2.2.4-10. I have
received instructions from Jerzy Jamrozy, and below are the answers he
gives and the further questions I have: 

Jerzy Jamrozy wrote:
> 
> Hi,
> 
> 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

> 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: 

iptables -append FORWARD -i eth0 204.49.23.64/26 -dst 192.168.0.0/24 -j
MASQ

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? 

> 4) setup a separate DHCP on your gateway - just for 192.168 machines with
> def. gateway set to 192.168.0.1

Do I have to set up the DHCP on the gateway? I was hoping I could set it
up on one of my servers, then have make it so that the server has an IP
address on the old as well as on the new network.  

> 5) voila.. i think.. ;)
> 
> J.J.

If someone can help me with the details, that would be tremendously
appreciated. 

Thanks

Hugo 

-- 
Dr Hugo Bouckaert
R&D Support Engineer/Systems Administrator 

Fractal Graphics 
57 Havelock St
West Perth, WA 6005
PO Box 1675, West Perth 6872

Ph:       61 08 9211 6000 
Fax:      61 08 9226 1299 

www.fractalgraphics.com.au 

------------------------------------------------------------------------
This email and any attachments may be confidential or legally
privileged. If you received this message in error or are not the
intended recipient, you should destroy the e-mail message and any
attachments or copies, and you are prohibited from retaining,
distributing, disclosing or using any information contained herein.
Please inform us of the erroneous delivery by return e-mail. Thank you
for your cooperation.
Re: how to set up a 192.168.xxx.xxx network next to existing network
#391
Author: Pieppo
Date: Wed, 29 May 2002 12:43
52 lines
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
Re: how to set up a 192.168.xxx.xxx network next to existing network
#390
Author: Jon Rook
Date: Wed, 29 May 2002 12:44
96 lines
5378 bytes
hugo wrote:
> 
> Hi
> 
> I received a useful reply on how to set up a 192.168.xxx.xxx network
> next to my existing one, but I am still not quite sure on how to
> implement the changes. Aor my gateway and router I am running linux 6.2
> (kernel 2.4.2-2) with iptables-1.2.1a-1 and iproute-2.2.4-10. I have
> received instructions from Jerzy Jamrozy, and below are the answers he
> gives and the further questions I have:
> 
> Jerzy Jamrozy wrote:
> >
> > Hi,
> >
> > 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
> 
> > 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:
> 
> iptables -append FORWARD -i eth0 204.49.23.64/26 -dst 192.168.0.0/24 -j
> MASQ
> 
> 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?
> 
> > 4) setup a separate DHCP on your gateway - just for 192.168 machines with
> > def. gateway set to 192.168.0.1
> 
> Do I have to set up the DHCP on the gateway? I was hoping I could set it
> up on one of my servers, then have make it so that the server has an IP
> address on the old as well as on the new network.
> 
> > 5) voila.. i think.. ;)
> >
> > J.J.
> 
> If someone can help me with the details, that would be tremendously
> appreciated.
> 
> Thanks
> 
> Hugo

Hugo,

1)Re Interface setup: 
  Not sure which distribution you are runing, but most of the more
popular ones have a GUI tool that can be used to set up an interface. 
Do some snooping around in your system and you should be able to find
it.  
2) Re NAT:
  You are correct in that NAT/Masquerading is done in IPTables.  You are
also correct that it is done via the FORWARD chain.  However, I think
you have the direction wrong.  You want to masquerade hosts on your
192.168.x.x net.  Masquerading will give packets sent from one of these
hosts a source IP address of the "other" interface.  I.e. outgoing
packets from your internal network will look to someone on the internet
like they came from the gateway machine.  I'm not an IPTables expert,
but it looks to me like you are trying to masquerade packets destined
for the 192.168 network.  It should go the other way.
3) Re IP Forwarding:
  NAT is different than IP forwarding, so the above will not take care
of it.  When enabled, IP Forwarding allows your machine to act like a
gateway. I.e. to pass packets from one network to another.  Forwarding
can be enabled by entering the line:
echo 1 > /proc/sys/net/ipv4/ip_forward
This will enable forwarding until the next reboot.  If you always want
your machine to be a gateway, put this command into a startup script so
that the command is executed on every reboot.  The file
/etc/rc.d/rc.local is intended for "local" startup commands and so is a
logical place to put this command.
4) Re DHCP:
  No, you don't have to run DHCP from the linux box.  In fact, you don't
even have to run DHCP at all.  In that case you would have to give a
fixed IP address to every host (interface) on the network.

Good luck,
Jon
Re: how to set up a 192.168.xxx.xxx network next to existing network
#393
Author: ronnie
Date: Tue, 30 Jul 2002 11:45
87 lines
4343 bytes
test
"hugo" <hugo@fractalgraphics.com.au>
???????:3CF4400C.D16FE45C@fractalgraphics.com.au...
> Hi
>
> I received a useful reply on how to set up a 192.168.xxx.xxx network
> next to my existing one, but I am still not quite sure on how to
> implement the changes. Aor my gateway and router I am running linux 6.2
> (kernel 2.4.2-2) with iptables-1.2.1a-1 and iproute-2.2.4-10. I have
> received instructions from Jerzy Jamrozy, and below are the answers he
> gives and the further questions I have:
>
> Jerzy Jamrozy wrote:
> >
> > Hi,
> >
> > 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
>
> > 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:
>
> iptables -append FORWARD -i eth0 204.49.23.64/26 -dst 192.168.0.0/24 -j
> MASQ
>
> 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?
>
> > 4) setup a separate DHCP on your gateway - just for 192.168 machines
with
> > def. gateway set to 192.168.0.1
>
> Do I have to set up the DHCP on the gateway? I was hoping I could set it
> up on one of my servers, then have make it so that the server has an IP
> address on the old as well as on the new network.
>
> > 5) voila.. i think.. ;)
> >
> > J.J.
>
> If someone can help me with the details, that would be tremendously
> appreciated.
>
> Thanks
>
> Hugo
>
> --
> Dr Hugo Bouckaert
> R&D Support Engineer/Systems Administrator
>
> Fractal Graphics
> 57 Havelock St
> West Perth, WA 6005
> PO Box 1675, West Perth 6872
>
> Ph:       61 08 9211 6000
> Fax:      61 08 9226 1299
>
> www.fractalgraphics.com.au
>
> ------------------------------------------------------------------------
> This email and any attachments may be confidential or legally
> privileged. If you received this message in error or are not the
> intended recipient, you should destroy the e-mail message and any
> attachments or copies, and you are prohibited from retaining,
> distributing, disclosing or using any information contained herein.
> Please inform us of the erroneous delivery by return e-mail. Thank you
> for your cooperation.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads