Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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).
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.