View previous topic :: View next topic |
Author |
Message |
Cocobo-1 Apprentice


Joined: 18 Dec 2003 Posts: 166 Location: Sweden
|
Posted: Fri Apr 15, 2005 8:48 am Post subject: One IP two boxes? |
|
|
I got 2 boxes with one NIC each. They had separate ip addresses and where connected to the Internet throu a switch. Yesterday my isp changed and will only supply one public ip address for a while. This means that one of the boxes have no connection. Is there some easy way to fix this. I don't have time to play around and I'll get an additionall ip in a couple of weeks. The box without a connection don't need Internet. It just needs to access the other box. _________________ Professor: "Good news, everyone. Several years ago I tried to log onto AOL, and
it just went through. Whee! We're online." |
|
Back to top |
|
 |
nahpets Veteran


Joined: 05 Oct 2003 Posts: 1178 Location: Montreal, Canada
|
Posted: Fri Apr 15, 2005 8:55 am Post subject: |
|
|
1. Use a router instead of a switch.
2. Get a third ethernet card, put it in the box which has the public IP. Set up eth1 on the box to have IP 192.168.1.1 or something similar. Set up box 2 to have 192.168.1.2. You can set up the first box to route traffic to the second box using shorewall. |
|
Back to top |
|
 |
zieloo Veteran


Joined: 28 Mar 2004 Posts: 1337
|
Posted: Fri Apr 15, 2005 9:11 am Post subject: |
|
|
Add second NIC and masquarade the line? |
|
Back to top |
|
 |
Cocobo-1 Apprentice


Joined: 18 Dec 2003 Posts: 166 Location: Sweden
|
Posted: Fri Apr 15, 2005 9:22 am Post subject: |
|
|
That's not what I would call an easy fix. I will not buy stuff to make it work. I hear there is a way to create 2 devices from one NIC. Could I use this to make one device my public ip and set the other to 192.168.0.1 and my other box to 192.168.0.2 so they could talk to eachother? _________________ Professor: "Good news, everyone. Several years ago I tried to log onto AOL, and
it just went through. Whee! We're online." |
|
Back to top |
|
 |
Shopro l33t


Joined: 12 May 2004 Posts: 678 Location: Dayton, OH, USA
|
Posted: Fri Apr 15, 2005 11:02 am Post subject: |
|
|
You might want to have a look at this, maybe it is what your looking for.
https://forums.gentoo.org/viewtopic-t-269710.html _________________ Just because I have nothing to say is no reason why you shouldn't listen. |
|
Back to top |
|
 |
fvant Guru

Joined: 08 Jun 2003 Posts: 328 Location: Leiden, The Netherlands
|
Posted: Fri Apr 15, 2005 11:24 am Post subject: |
|
|
so you have 2 boxes A and B.
A has a public IP and internet access.
B only needs to talk to A
you have a hub or switch.
On A, create an alias for eth0, so it has 2 IP adresses, one public (eth0) and one local (eth0:0) (e.g. in the range 192.168.10.x)
Code: | ifconfig eth0:0 192.168.10.1 |
on B, change the IP to a local one (in the same range as on A, 192.168.10.x)
now B and A are connected and A has internet access.
If B needs internet access, configure A to provide NAT. |
|
Back to top |
|
 |
|