You are not logged in.

#1 2009-10-23 18:33:50

Lich
Member
Registered: 2009-09-13
Posts: 437

Setting up a LAN with shared internet

Ok so I have the following hardware to work with:
1. A wireless access point that I don't have admin access to. It's a free wireless hotspot that feeds internet to my laptop.
2. A laptop with a wireless adapter and ethernet card running Arch.
3. An OpenBSD server with no usb or wireless, just ethernet.
4. A normal LAN switch.
5. Ethernet cables

What I want is to set up a LAN with these two machines, and to share the internet from my laptop through the switch with the OpenBSD server (or any machine that I may connect in the future).
How would I set this thing up? Any ideas, hints or step by step HOWTOs are welcomed smile


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#2 2009-10-24 02:50:19

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Setting up a LAN with shared internet

Alter /etc/sysctl.conf and set this to 1:

net.ipv4.ip_forward=1

Then install iptables

pacman -S iptables

And configure a rule set something like:

iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
/etc/rc.d/iptables save

Configure the OpenBSD server to use your laptop as it's default gateway and that should be the absolute bare minimum to get you going. You can then look at installing a DNS server (dnsmasq or bind), tighter firewall rules etc.

Last edited by fukawi2 (2009-10-24 02:50:58)

Offline

#3 2009-10-24 12:34:32

Lich
Member
Registered: 2009-09-13
Posts: 437

Re: Setting up a LAN with shared internet

Thanks a lot, will give this a go. This will have no effect on my laptop's browsing experience though, right? I can still use that to browse, it doesn't just redirect the connection?


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#4 2009-10-24 13:28:23

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Setting up a LAN with shared internet

Lich wrote:

This will have no effect on my laptop's browsing experience though, right?

Correct.

Offline

Board footer

Powered by FluxBB