Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Advice: wired box through wireless box to internet?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Thu Mar 09, 2006 1:29 am    Post subject: Advice: wired box through wireless box to internet? Reply with quote

Hi all,

I'm needing some advice on how best to do this. I'm currently in a hotel (Katrina has me out of home). I have 2 boxes. One with wireless card that connects to hotel wireless network. It also has a wired NIC card too. I have a 2nd box, it only has a wired nic card. I need the 2nd box to be able to connect to the internet so I can upgrade gentoo on it and applications to do some work.

Both boxes are Gentoo linux..

I also have a wired, regular router here.

Is the some way to have the 1st box connect to the internet, and server as a gateway to the 2nd box?

Can you suggest software and connection ways to do this? I'm a networking noob.

Do I need the router, or can I do this somehow with a crossover cable between the 2 nic cards?

Do I somehow need to set up the 1st box as a dhcp server?

Would I set up squid or something as the web proxy on the 1st box..or can I somehow get the 1st box to look like a regular gateway to the internet to the 2nd box?

Can someone help me out with best hardware config...and software config?

The 2nd box is kernel 2.4x...the 1st box is 2.6x.

I need to get some work done here soon....and any help is GREATLY appreciated.

Thank you in advance,

cayenne
_________________
Light travels faster than sound. This is why some people appear bright until you hear them speak.........
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Thu Mar 09, 2006 2:04 am    Post subject: Re: Advice: wired box through wireless box to internet? Reply with quote

cayenne wrote:
Can you suggest software and connection ways to do this? I'm a networking noob. Do I need the router, or can I do this somehow with a crossover cable between the 2 nic cards?

The crossover cable is enough.
cayenne wrote:
Do I somehow need to set up the 1st box as a dhcp server? Would I set up squid or something as the web proxy on the 1st box..or can I somehow get the 1st box to look like a regular gateway to the internet to the 2nd box?

You don't need any of this to share a connection between two machines.
cayenne wrote:
Can someone help me out with best hardware config...and software config?

On the first machine (the one with wireless and wired): install iptables (and if you don't have them, select all the iptables options in the kernel configuration as modules, and recompile the kernel), configure the wired interface with IP 192.168.1.1 (in /etc/conf.d/net), and run those commands (you can put them in /etc/conf.d/local.start so that they are run at each boot):
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

The first line allows the kernel to do routing between interfaces, the second will cause it to do the necessary address translation (so that both machines can use the same "external" IP address). If your wireless interface is not wlan0, then replace that by the correct interface name.

On the second machine: configure the interface with IP 192.168.1.2 and gateway 192.168.1.1, check that you can ping 192.168.1.1, and copy the /etc/resolv.conf file from the first machine. Then check you can ping a machine on the Internet.

Be careful though. If your wireless connection already uses an address that looks like 192.168.1.*, don't use those addresses for the internal network (use 192.168.2.1 and 192.168.2.2 in that case).
Back to top
View user's profile Send private message
brims
Guru
Guru


Joined: 19 Apr 2004
Posts: 492
Location: Arizona

PostPosted: Thu Mar 09, 2006 2:27 am    Post subject: Reply with quote

On the first machine that has a wireless card, you'll need to set up ipforwarding and IP masquerading, there may be a way to do this without masquerading, I am unsure how to do this. Gentoo Home Router Guide is a good resource. You can setup a DHCP server and DNS on that machine, but with having 2 computers I'd recommend using static IPs, it'll be easier. If you put a DNS server on that machine, have the other machine use the machine with a wireless card as it's DNS server, if you don't want to, have the second computer use the hotel's DNS server.

I hope this isn't to confusing, if it is, I will try to clearify it.
_________________
Adopt an Unanswered Post
Report violations, duplicates, misplaced, etc
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum