Sign in with
Sign up | Sign in
Your question

Ubuntu Network

Last response: in Linux/Free BSD
Share
April 27, 2010 7:45:34 PM

I am setting up a home network with ubuntu being the server for my network. I currently have it up and running just fine, I have 2 nic cards eth0 and eth1, I'm wanting to use eth0 for the server to connect to the internet directly, and use eth1 to connect to the swith to share the internet and file system of the server, I have setup so far that I do have internet on the server and I have been able to ping my windows machine but I cannot get the windows machine to connect to the server,

i'm brand new to the ubuntu family and this is my first time actually setting up a network with a server and a switch involve.

thanks for all the comments.

More about : ubuntu network

April 27, 2010 7:49:44 PM

Basically, you want to set your Ubuntu up as a router. Here's a link that should get you started with that.
Related resources
April 27, 2010 7:52:51 PM

Thanks for the quick response
April 27, 2010 8:04:54 PM

I'd agree about putty, but I always install webmin on my *nix systems. It's especially useful with my FreeBSD server which runs headless. (That plus XMing for an XWindow connection and putty for emergencies.)

Webmin does make life easier when configuring DHCP, DNS and firewalls (and lots of other servers as well).
April 27, 2010 8:14:27 PM

Webmin is great in the hands of an experienced user but it's also a security threat if it's not totally locked down. :) 

There's been a lot of incidents of E.V.I.L peeps targeting open source routers with default passwords and other vulnerabilities as well as webmin and lots of other management tools.

It's always best to drop all incoming connections to webmin, ssh and just about all other services on a router.

Semper Fi :) 
April 27, 2010 8:18:04 PM

Fair point. None of my Webmin based machines are visible to the outside world, whereas in this case it would be. dizital needs to take extra care to get the firewall set up safely.
April 27, 2010 8:39:06 PM

yea i'm looking at getting a netgear wireless vpn/firewall, would the netgear replace my linksys wireless router or would i still need that?
April 27, 2010 8:50:36 PM

Linux can be a great VPN and firewall, you'll just have to find a nice Linux and BSD friendly wifi card.

You'll be able to combine wired, wireless, firewall and VPN functions in the same Linux system if that's what you want to do.

Good luck :) 
April 27, 2010 9:09:02 PM

That's what my intentions are, I currently have all computers connected to the linksys router, as I'm currently setting up the server with the switch
April 28, 2010 6:45:16 AM

Ijack said:
Basically, you want to set your Ubuntu up as a router. Here's a link that should get you started with that.



On the steps that it shows I can't get my machine to setup the network cards, all I can get it to do is the address and the subnet address. I have no netmask address, broadcast address network address like the example show. It saids that he added the code to the file but, I don't know how to add the code to the file, any help in that area?
April 28, 2010 11:02:09 AM

I take it the problem is with the eth1 interface? To add the code to the file just use a text editor to open the file /etc/network/interfaces and type the code in. You'll need to be logged on as root to do this. Hence the "su" command first, which changes your logon to root temporarily (you'll be prompted for the root password). The server will act as a DHCP server for other computers on your network, but it needs to be set up with a fixed address itself. The one used here is just one from the available non-routable addreses that are available for private networks.

Most Linux configuration is simply a matter of editing text files like this. The link show use of the "vi" editor, but this is a little unfriendly; any text editor will do. If you're going to play around with Linux it's a good idea to get to know "vi"; it's the one editor that you can be 99.9% sure is available on any *NIX system and it may well be the only editor that will be available if you ever have to boot in single-user mode.
April 29, 2010 7:08:23 PM

Ijack said:
I take it the problem is with the eth1 interface? To add the code to the file just use a text editor to open the file /etc/network/interfaces and type the code in. You'll need to be logged on as root to do this. Hence the "su" command first, which changes your logon to root temporarily (you'll be prompted for the root password). The server will act as a DHCP server for other computers on your network, but it needs to be set up with a fixed address itself. The one used here is just one from the available non-routable addreses that are available for private networks.

Most Linux configuration is simply a matter of editing text files like this. The link show use of the "vi" editor, but this is a little unfriendly; any text editor will do. If you're going to play around with Linux it's a good idea to get to know "vi"; it's the one editor that you can be 99.9% sure is available on any *NIX system and it may well be the only editor that will be available if you ever have to boot in single-user mode.



Should the connects thats going to support my network that is going to be connected to the switch be a static ip or can it be a dhcp, i'm thinking static so it doesnt change but i could be wrong.
April 29, 2010 7:17:19 PM

how do i open the text editor with root privileges to make the changes??
April 29, 2010 7:24:06 PM

sudo NAME_OF_EDITOR
April 29, 2010 7:31:59 PM

Yes, the interface that connects to the switch (eth1) should be a fixed IP address (at least it's going to be a lot easier that way).

As audiovoodoo says, "sudo" will give root privileges for one command (as long as the "/etc/sudoers" file is correctly set up, which I guess it will be with Ubuntu). It will prompt you for a password, which is your password. Alternatively, "su" changes the terminal session to a root logon until you "exit" it. This also prompts for a password, but this time it is the root password, not your password.

"sudo" is generally considered the safer option as you don't need to remember to cancel the elevation of privilege.
April 30, 2010 6:13:47 AM

Ijack said:
Yes, the interface that connects to the switch (eth1) should be a fixed IP address (at least it's going to be a lot easier that way).

As audiovoodoo says, "sudo" will give root privileges for one command (as long as the "/etc/sudoers" file is correctly set up, which I guess it will be with Ubuntu). It will prompt you for a password, which is your password. Alternatively, "su" changes the terminal session to a root logon until you "exit" it. This also prompts for a password, but this time it is the root password, not your password.

"sudo" is generally considered the safer option as you don't need to remember to cancel the elevation of privilege.



Would I need to set a host name for the gateway? I'm not going to have a website.
April 30, 2010 6:17:25 AM

You don't need to set a hostname for the gateway. But it can be convenient, for example if you wanted to access it from another computer via SSH or run other services on it. I always give all of my machines, real or virtual, a name for this reason.

No device on the Internet needs a name, but it makes life a whole lot easier.
April 30, 2010 9:57:40 PM

Ijack said:
You don't need to set a hostname for the gateway. But it can be convenient, for example if you wanted to access it from another computer via SSH or run other services on it. I always give all of my machines, real or virtual, a name for this reason.

No device on the Internet needs a name, but it makes life a whole lot easier.



On setting up the static ip address on my other machines which ip address do I need to give them,

the address, network or the broadcast ip address,

also when i goto windows to set the static ip address do i need to give it a gateway address cause my server eth1 doesn't have a gateway address either.

I'm currently installing webmin ask its asking me for a port number for my web server, is there one already setup or am I creating one at this point?
April 30, 2010 10:27:46 PM

when i try to install this line

apt-get install dhcp3-server bind9 vim perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

i get this error E: Couldn't find package bond9
April 30, 2010 10:31:39 PM

nevermind on this one, i caught the error, type error lol
May 1, 2010 12:18:52 AM

on the webmin application it saids to configure the dhcp but where exactly do i go to setup that? under the server tab?
May 1, 2010 4:24:27 AM

You don't need a gateway on the internal network card ( eth1 ) like 10.0.0.1

Configure dhcp to set the router to 10.0.0.1 if your eth1 is configured with that IP.

You'll have to enter your gateway for the external network card ( eth0 ) 24.0.0.? -- that's just an example you'll need to get your IP from your provider.

Take a look at the wiki http://doxfer.com/Webmin

Good luck :) 
May 1, 2010 9:36:14 AM

Ok, I have no idea what I'm doing wrong at this point, I've tried changing this differant times, but I'm constantly getting bad subnet/mask combination subnet 192.168.25.1 netmask 255.255.255.0
May 1, 2010 10:30:57 AM

192.168.25.1 isn't a valid address for a subnet. With that netmask you need 192.168.25.0.
May 1, 2010 10:59:37 AM

Ijack said:
192.168.25.1 isn't a valid address for a subnet. With that netmask you need 192.168.25.0.


Why does that one number make such a differance?, I'm confused about that
May 1, 2010 3:28:14 PM

An IP address is composed of two parts, the network (or subnet) part and the host part. The netmask tells you which part is which. So, without going into too much detail, a netmask of 255.255.255.0 says that, when you look at the IP address as a 32-bit number, the first 24 bits are the network and the last 8 bits are the host.

So the last 8 bits of the network address, in this case, have to be zeros. Conventionally the network is referred to as this number; in your case this would be 192.168.25.0. So for the host part, all zeros is reserved to refer to the network. All ones is also reserved for something called the broadcast address (a packet sent to that address will be delivered to every host in the network; in your example this is 192.168.25.255. The other 254 numbers (192.168.25.1 - 192.168.25.254) are available as addresses for hosts.

A network address doesn't necessarily end in a 0. If your netmask was 255.255.255.128 then 192.168.255.128 would be a valid network number. In this case you have subnetted the class C address into two networks (with available host addresses 192.168.25.1 - 192.168.25.126 and 192.168.25.129 - 192.168.25.254). If you think about it, a network address always has to end in a multiple of 4. So 192.168.25.1 can never be a network address.

If it all seems complicated, it's not really - once you get used to it. It may be worth your while finding a simple introduction to TCP/IP to explain these things better than I can.
May 2, 2010 12:20:17 PM

Ok, right now I'm just trying to figure out whats wrong here, on webmin i have the subnet created, with the following information

webmin configuration
ip address range 192.168.25.50 192.168.25.58
network address 192.168.25.8
netmask 255.255.255.0
broadcast 192.168.25.255


my computer info:
address 192.168.25.0
netmask 255.255.255.0
network 192.168.25.8
broadcast 192.168.25.255

I set my vista machine with the ip address of 192.168.25.50 subnet 255.255.255.0

My vista machine saids unidentified network with it being plugged into the switch and the switch connects to the server
May 2, 2010 12:44:25 PM

Ok, right now I'm just trying to figure out whats wrong here, on webmin i have the subnet created, with the following information

webmin configuration
ip address range 192.168.25.120 192.168.25.128
network address 192.168.25.0
netmask 255.255.255.0
broadcast 192.168.25.255


my computer info:
address 192.168.25.0
netmask 255.255.255.0
network 192.168.25.8
broadcast 192.168.25.255

I set my vista machine with the ip address of 192.168.25.50 subnet 255.255.255.0

My vista machine saids unidentified network with it being plugged into the switch and the switch connects to the server
May 3, 2010 2:15:54 AM

Correct me if i am wrong, i haven't done a whole lot of work with networking, but wouldn't your address on vista need to fall inside the ip address range as stated in webmin (aka between .120 and .128)?
May 3, 2010 6:22:09 AM

kyeana said:
Correct me if i am wrong, i haven't done a whole lot of work with networking, but wouldn't your address on vista need to fall inside the ip address range as stated in webmin (aka between .120 and .128)?


It is in the range of the ip address, thats what i dont understand why it still telling me unidentified network
I have it set at the .120
May 3, 2010 6:22:51 AM

the my computer setting is the server info not the vista machine
May 3, 2010 6:31:19 AM

If I read your setting correctly you have the server address set as 192.168.25.0 with a netmask of 255.255.255.0. With that netmask 192.168.25.0 is a network address and is not valid as a host address. Set your network to 192.168.25.0 and your server address to, say, 192.168.25.1.



You might find it easier if you follow the link that I gave exactly, and use the addresses in that example for configuration oth eth1 and DHCP.
May 4, 2010 8:32:03 PM

Ijack said:
If I read your setting correctly you have the server address set as 192.168.25.0 with a netmask of 255.255.255.0. With that netmask 192.168.25.0 is a network address and is not valid as a host address. Set your network to 192.168.25.0 and your server address to, say, 192.168.25.1.



You might find it easier if you follow the link that I gave exactly, and use the addresses in that example for configuration oth eth1 and DHCP.


Ok I got my vista machine connected to the network, but its not getting internet access, Server has internet, final stage for my network lol.

May 4, 2010 8:44:04 PM

sudo echo 1 > /proc/sys/net/ipv4/ip_forward

Have you setup your iptables yet? If you haven't done it you need to.

Good luck :) 
May 5, 2010 6:14:19 AM

linux_0 said:
sudo echo 1 > /proc/sys/net/ipv4/ip_forward

Have you setup your iptables yet? If you haven't done it you need to.

Good luck :) 


On setting up the iptables on webmin, thats done under the firewall settings or on the server itself?
May 7, 2010 7:06:56 PM

finally got the first computer connected to the internet, thanks alot for all the information and the patience with me.
May 7, 2010 8:58:43 PM

Enjoy! Learning is fun.
!