The only potential problem with this method is the network he is on,
is most likely using DHCP

On Thu, 23 Jan 2003, Gary Stainburn wrote:

> On Wednesday 22 Jan 2003 8:47 pm, dbrett wrote:
> > The short answer is yes
> >
> > You will need a cross over cable to connect the two computers together.
> > You will also have to set-up another network between the two computers.
> > Unfortunately, this means NATing will have to be set-up.  The office
> > network will not know about your network you just set-up.
> >
> > david
> 
> However, you can make the second box appear to everyone else that it's 
> directly connected to the same wire. i.e. the routing is transparrent.
> 
> Here's a simple example:
> Box1 is the main Linux box, with 10.1.1.20 as it's IP address on eth0
> Box2 is the relay'd box with 10.1.1.21 as it's IP address
> 
> Box1 has eth1 set as 192.168.1.1/24
> Box2 has eth0 set as 192.168.1.2/24 and box1 set as it'd default route.
> 
> Box2 is a bog standard IP networking config and I won't cover it.
> 
> On Box 1, create the file /etc/sysconfig/network-scripts/ifcfg-eth0:1 as 
> follows (amend as necessary):
> 
> DEVICE=eth0:0
> ONBOOT=yes
> BOOTPROTO=static
> BROADCAST=10.1.255.255
> NETWORK=10.1.0.0
> NETMASK=255.255.0.0
> IPADDR=10.1.1.21
> GATEWAY=10.1.1.101
> TYPE=Ethernet
> PEERDNS=no
> 
> Then edit /etc/sysctl.conf  to set
> 
> net.ipv4.ip_forward = 1
> 
> This has now set an I/F of 10.1.1.21 on eth0:0 on box1, and enabled IP 
> forwarding.  This tells everyone else to send IP traffic for 10.1.1.21 to 
> 10.1.1.20 and allows box2 to make outbound connections.
> 
> Then create /etc/sysconfig/iptables to contain something like:
> 
> # Generated by iptables-save v1.2.5 on Fri Jan 17 14:50:07 2003
> *nat
> :PREROUTING ACCEPT [1490:290942]
> :POSTROUTING ACCEPT [33:2048]
> :OUTPUT ACCEPT [22:1452]
> -A PREROUTING -d 10.1.1.21 -j DNAT --to-destination 192.168.1.2
> -A POSTROUTING -i eth1 -j MASQUERADE
> COMMIT
> # Completed on Fri Jan 17 14:50:07 2003
> # Generated by iptables-save v1.2.5 on Fri Jan 17 14:50:07 2003
> *filter
> :INPUT ACCEPT [2001:354022]
> :FORWARD ACCEPT [879:116086]
> :OUTPUT ACCEPT [460:57383]
> COMMIT
> # Completed on Fri Jan 17 14:50:07 2003
> 
> Probably the best bet is to turn of the IPTABLES service which flushes all 
> existing rules, then issue the commands 
> 
> iptables -A PREROUTING -d 10.1.1.21 -j DNAT --to-destination 192.168.1.2
> iptables -A POSTROUTING -i eth1 -j MASQUERADE
> iptables-save >/etc/sysconfig/iptables
> 
> to create the file.
> 
> This will then give Box2 access to the network - although is is NAT'd as Box1.
> It will also give the network access to Box2 - again through a NAT'd 
> connection.
> 
> NATting is required to hide the fact that Box2 is actually set on 192.168.1.2.
> 
> Hope that helps
> 
> Gary
> 
> 
> >
> > On Wed, 22 Jan 2003, Tibbetts, Ric wrote:
> > > Ok, this is an easy one... Or should be.
> > >
> > > I have a slight situation. My "cube" is short on network jacks, but long
> > > on computers. One of them has 2 NICs in it (a RH 8.0 box). Can I use box
> > > 1 to route for box 2?
> > >
> > > I don't need NAT, or IP Masq'ing or firewalling, or any of that. Just a
> > > way to get 2 devices pluged into 1 jack.... (don't have a hub...can't
> > > put one in...).
> > >
> > > Thanks!
> > >
> > > Ric
> > >
> > >
> > >
> > > --
> > > redhat-list mailing list
> > > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> > > https://listman.redhat.com/mailman/listinfo/redhat-list
> 
> -- 
> Gary Stainburn
>  
> This email does not contain private or confidential material as it
> may be snooped on by interested government parties for unknown
> and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     
> 
> 



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to