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.
You may have seen some other posts by me about my final year college project. Im implementing a web based network management website.
Iv got a lot of the functionality working at this stage but one part is allocating bandwidth.
Iv got an eircom 3mb broadband connection and I want to be able to split this between users. At the moment I only have my desktop and laptop on the network. Im looking for advice on how i can allocate bandwidth with iptables and/or the tc tool in ubuntu.
My website is on an ubuntu virtual machine and written in php. Whatever about running the iptables and tc commands from php I still need to figure out the actual commands i need to use in the first place.
Can anyone give me some advice on how i can do this? Thanks
There is actually a guide I used for testing a setup using tc a while back but I had to change something in it, now I don't recall what I had to change but I did find the guide--
There is actually a guide I used for testing a setup using tc a while back but I had to change something in it, now I don't recall what I had to change but I did find the guide--
Give that a try and if it has an issue come back and we'll help you figure the issue once we know what it is.
Hi rweaver,
This tutorial seems to assume you have linux set up as a router. My set up is ubuntu on a virtual machine with windows xp on the host machine. There is also a laptop on my network. These are connected to a netopia 2247 nwg ADSL router for internet access. I have a 3mb broadband connection.
I want to allocate this 3mb between say the windows xp host and the laptop. Is this possible from the ubuntu vm?
Sorry now if im asking stupid questions but im just really confused by all this stuff.
Yes it is possible, however it will be difficult without a basic understanding of the networking involved.
You will need to:
set two bridged network adapters for the guest OS (ubuntu) from your VM server software.
Then you will need to set up one of the interfaces to have an IP address in the range of your router
Setup the other interface to be in a separate network range
Set the two physical computers to use the same IP range as the second interface on the virtual machine with the virtual machine IP set as the default gateway
Then you need to setup the virtual machine as a router to route between the two networks
That might be confusing so I will try to give you a more specific example.
By setting the network interfaces in bridged mode from your VM server, we can pretend that the VM is a physically separate computer. And by setting the IP ranges to be different between the computers and the router we can make them have logical network separation too. The VM will join the two logically separated networks because it is the only device able to communicate with both the computers and the ADSL router.
Look at the diagram I have attached to get a better idea of what I mean.
If you need any further help implementing the above, you will need to post with more details about your current setup. Post IP addresses of all of your devices (including the ADSL router) and also the details of your VM software.
Yes it is possible, however it will be difficult without a basic understanding of the networking involved.
You will need to:
set two bridged network adapters for the guest OS (ubuntu) from your VM server software.
Then you will need to set up one of the interfaces to have an IP address in the range of your router
Setup the other interface to be in a separate network range
Set the two physical computers to use the same IP range as the second interface on the virtual machine with the virtual machine IP set as the default gateway
Then you need to setup the virtual machine as a router to route between the two networks
That might be confusing so I will try to give you a more specific example.
By setting the network interfaces in bridged mode from your VM server, we can pretend that the VM is a physically separate computer. And by setting the IP ranges to be different between the computers and the router we can make them have logical network separation too. The VM will join the two logically separated networks because it is the only device able to communicate with both the computers and the ADSL router.
Look at the diagram I have attached to get a better idea of what I mean.
If you need any further help implementing the above, you will need to post with more details about your current setup. Post IP addresses of all of your devices (including the ADSL router) and also the details of your VM software.
Thanks for the reply SuperJediWombat!.
Here is a list of the current ip addresses on my network.
ADSL Router (Netopia 2247-NWG Vgx): 192.168.1.254
Desktop: 192.168.1.2
Laptop: 192.168.1.15
My vm software is VMWare Workstation 6.5.
My vm is Ubuntu 9.10. I currently have 1 bridged network adapter on this virtual machine. Will I have to reinstall the virtual machine to add another network adapter?
Hopefully not.
I have my website on this vm.
Thanks again for your reply. You have given me a clearer picture of what I need to do.
For ubuntu, add that to rc.local or something because it won't stay after a reboot.
/proc/sys/net/ipv4/ip_forward is a special file that tells the kernel what to do if it receives a packet that is addressed to another computer. If it is sent to '1' the kernel will look at the routing table, and work out what interface to send it out on.
You will also need to set up either a static route on the ADSL router, telling the router about the second network.
So open the web interface of your router, look for a page for entering 'static routes' and tell it that network '10.2.2.0/24' or '10.2.2.0 / 255.255.255.0' is on the gateway 10.1.1.250. If it wants a 'metric' or 'hops' just use '1'
The other option would be to setup NAT on your ubuntu box. This would mean that you wouldn't need to do the static route from your router, but it would slightly increase the overhead on your VM and might cause you some problems if you use any strange network protocols from your desktop/laptop.
If you want to enable NAT, run this command from your ubuntu VM
Replace 'eth1'with whatever your external interface is (the one on the same IP range as your ADSL router)
And replace '10.2.2.0/24' with the IP range you have set for your Desktop/Laptop
For ubuntu, add that to rc.local or something because it won't stay after a reboot.
/proc/sys/net/ipv4/ip_forward is a special file that tells the kernel what to do if it receives a packet that is addressed to another computer. If it is sent to '1' the kernel will look at the routing table, and work out what interface to send it out on.
You will also need to set up either a static route on the ADSL router, telling the router about the second network.
So open the web interface of your router, look for a page for entering 'static routes' and tell it that network '10.2.2.0/24' or '10.2.2.0 / 255.255.255.0' is on the gateway 10.1.1.250. If it wants a 'metric' or 'hops' just use '1'
The other option would be to setup NAT on your ubuntu box. This would mean that you wouldn't need to do the static route from your router, but it would slightly increase the overhead on your VM and might cause you some problems if you use any strange network protocols from your desktop/laptop.
If you want to enable NAT, run this command from your ubuntu VM
Replace 'eth1'with whatever your external interface is (the one on the same IP range as your ADSL router)
And replace '10.2.2.0/24' with the IP range you have set for your Desktop/Laptop
Hi mate.
Just a bit confused about configuring the static route on my router.
Im giving the router an ip address of 192.168.0.1.
The two windows machines are on the range of 192.168.1.0/24
I found the page to configure a static route on the router but not sure what address to put in.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.