LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2007, 11:21 AM   #1
RicardoB
LQ Newbie
 
Registered: Apr 2007
Location: The Netherlands
Distribution: Slackware-Current, Custom kernel 2.6.21.5
Posts: 17

Rep: Reputation: 0
IP Masquerading?


I have a network of 2 Windows boxes and a Slackware Linux box (Slackware-Current, 2.6 kernel), which is my personal box. The computers are interconnected by a router.

Now that I have another box (Slackware 12, 2.6 kernel) in the same room as the Slackware-Current box, I'm looking for a way to provide both computers with internet access. Connecting both of them to the router is not an option, only one of them can be connected to the router.

What I was thinking:

Turn the Slackware 12 box into a router (it has 3 network cards), with my personal Slackware-Current box as a client. This way, there would be a LAN inside a LAN (The LAN inside the LAN will be expanded to more than one client, later).

How would I be able to archive this?

I've tried the answer at

http://www.linuxquestions.org/linux/...ection_sharing

but I find it to be extremely vague. I've also tried ipkungfu, which is supposed to simplify the configuration of iptables, but to no avail.
 
Old 08-12-2007, 12:17 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
The first question when going into this is do you want to create a hidden subnet behind your new router box? Do you want to expand the current subnet? There are two ways to accomplish your goal, one is with iptables, and setting up another LAN via NAT. The other is to bridge the ethernet cards on your new router, and use it as a switch. This has the advantage of all of your boxes being on the same subnet.

For help with NAT on iptables I've found http://linuxhomenetworking.com to be a great help, but as for bridging; I've only done this under Gentoo. I don't know how well the instructions would translate to Slackware, but it might be worth a shot. Otherwise, google is our friend for all of our needs.

Regards,

Alunduil
 
Old 08-13-2007, 08:04 AM   #3
RicardoB
LQ Newbie
 
Registered: Apr 2007
Location: The Netherlands
Distribution: Slackware-Current, Custom kernel 2.6.21.5
Posts: 17

Original Poster
Rep: Reputation: 0
I got bridging to work, but that would basically render the bridging box useless, since it won't have an IP address, though that would be useful for a firewall, it's not what I want.

I found

http://www.novell.com/coolsolutions/feature/16579.html

for SuSE Linux and it gave me an idea of how to do things, though I'm not sure how to translate the instructions.

1. Get external card and it's hardware address
- Done

2. Get internal card and hardware address
- Done

3. Get name servers
- Done

4. Get gateway
- Done

5. Set up internal card to have 192.168.0.1 static IP
- How do I do this?

6. Set up routing
- Again, how? Slackware doesn't have YaST and I'm unable to translate the things it does to Slackware instructions. In the SuSE instruction the default gateway is entered and IP forwarding is enabled.

7. Enable masquerading
- How?

Any help?
 
Old 08-13-2007, 08:42 AM   #4
RicardoB
LQ Newbie
 
Registered: Apr 2007
Location: The Netherlands
Distribution: Slackware-Current, Custom kernel 2.6.21.5
Posts: 17

Original Poster
Rep: Reputation: 0
Alright, I came up with a quick hack on giving them both an internet connection:

# Enable external interface
ifconfig eth0 up
# Enable internal interface
ifconfig eth1 up

# Get IP address for external interface
ifconfig eth0 192.168.2.7 netmask 255.255.255.0 broadcast 192.168.2.255
# Get IP for external interface alias eth0:0
ifconfig eth0:0 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255

# Add the routes
route add -host 192.168.2.7 dev eth0
route add -host 192.168.2.10 dev eth0

# Set up a bridge
brctl addbr br0
# Add external interface alias to bridge
brctl addif br0 eth0:0
# Add internal interface to bridge
brctl addif br0 eth1

# Enable bridge
ifconfig br0 up

Edit: That didn't work for too long, sadly.

Last edited by RicardoB; 08-13-2007 at 09:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What exactly do I do for Ip Masquerading? DJOtaku Linux - Wireless Networking 13 06-10-2005 03:24 AM
masquerading ichbinesderelch Linux - Networking 23 08-19-2003 03:18 AM
IP masquerading. somebody help me! Johnsernickle Linux - Networking 4 10-22-2002 06:57 PM
IP Masquerading kwigibo Linux - Networking 3 09-21-2002 07:46 PM
ip masquerading artman62 Linux - Security 5 08-13-2002 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration