LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2007, 04:09 AM   #1
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Rep: Reputation: 15
Cool Network Contruction Help


Hi there,


I've got a Linux server and a router and other machines the ideia it's to have one network card to make access to the internet and the other to control internal network.

Does anyone have any step by step about this ?

Best Regards
 
Old 12-02-2007, 05:37 AM   #2
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
If you have a router, it will do what you want.

Modem>--Router>--Pc's
 
Old 12-02-2007, 06:07 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
... And here's a good HOWTO for linux networking:
http://www.yolinux.com/TUTORIALS/Lin...etworking.html
 
Old 12-04-2007, 05:54 AM   #4
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Could we have an example

Hi there

Thanks for the quick awnsers.

But could we have an example of that what I'm talking about ?

Something to understand how it works and why how to do it ?

Thanks

Best Regards
 
Old 12-04-2007, 06:11 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Quote:
Originally Posted by LMSSML View Post
Hi there

Thanks for the quick awnsers.

But could we have an example of that what I'm talking about ?

Something to understand how it works and why how to do it ?

Thanks

Best Regards
You could look at the LQ-Wiki-Network setup. This wiki page has a good example of a setup even though it's example is using Redhat. The methods are there.

The other example is a good one also. You should put a little work into the research of your question, along with some effort on your part.

We don't know your level of experience so the 'why you request' is rather broad. You will probably have to meld a lot of the examples to formulate what you don't understand.

You could look at the Network section of 'Slackware-Links' to get additional links. The list has a lot of Linux links.
 
Old 12-06-2007, 09:47 AM   #6
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool defining routes

Hi there !


I think it's all done that what I want but I have a problem I think with route

I have the following by route -n

Destination Gateway GenMask
192.168.H.0 0.0.0.0 255.255.255.0
192.168.J.0 0.0.0.0 255.255.255.0
0.0.0.0 192.168.H.H 0.0.0.0
0.0.0.0 192.168.J.J 0.0.0.0


And My router has the normal ip "10.0.0.2".

Adn I don't have internet, so I thought that if I had a route to route table between the router and the gateway 192.168.H.H could come and receive packets from internet but it's not correct.

So I've tried to make 10.0.0.2 has a gateway and I almost been there, but once again there it didn't work.

Could anyone explain to me what where I went wrong ?

Thanks

Best Regards
 
Old 12-06-2007, 10:28 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
If your router has an IP of 10.0.0.2, then it really is much simpler if you put all your PC's on a 10.0.0.X network, rather than a 192.186.x.y network. This is what I have always done, and I have never had to use the route command. But, if you have already set up your PC with 192.168.x.y addresses, then maybe it would be simpler to set your router to 192.168.0.1 address. It doesn't really matter, as long as the router & PCs are on the same subnet.

As you are using (k)ubuntu, then if you are still having problems, please post your /etc/network/interfaces file, and the output of ifconfig, and the address of your router. That should give us enough information to help you further.
 
Old 12-06-2007, 10:33 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Quote:
Originally Posted by LMSSML View Post
Hi there !
I think it's all done that what I want but I have a problem I think with route

I have the following by route -n

Destination Gateway GenMask
192.168.H.0 0.0.0.0 255.255.255.0
192.168.J.0 0.0.0.0 255.255.255.0
0.0.0.0 192.168.H.H 0.0.0.0
0.0.0.0 192.168.J.J 0.0.0.0

And My router has the normal ip "10.0.0.2".

Adn I don't have internet, so I thought that if I had a route to route table between the router and the gateway 192.168.H.H could come and receive packets from internet but it's not correct.

So I've tried to make 10.0.0.2 has a gateway and I almost been there, but once again there it didn't work.

Could anyone explain to me what where I went wrong ?

Thanks

Best Regards
This is an example of the normal output for the command 'route -n';

Code:
~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    1      0        0 eth0
You either cut the output or when you copied it wasn't complete.

I can't answer/advice because of the incomplete post.
 
Old 12-06-2007, 10:43 AM   #9
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Network interfaces config file

/etc/network/interfaces

auto eth1
iface eth1 inet static
address 192.168.J.J
netmask 255.255.255.0
network 192.168.J.0
broadcast 192.168.J.255
gateway 192.168.J.1


auto eth0
iface eth0 inet static
address 192.168.H.H
netmask 255.255.255.0
network 192.168.H.0
broadcast 192.168.H.255
gateway 192.168.H.1

if config
eth0
inet addr 192.168.H.1 Bcast:192.168.H.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
interrrupt 17
eth1
inet addr 192.168.J.1 Bcast:192.168.J.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
interrupt 19
lo
eth0
inet addr 127.0.0.1 Mask:255.0.0.0


I think this could be the information I could have to give
 
Old 12-06-2007, 10:43 AM   #10
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Route

Sorry


The router become 192.168.H.5
 
Old 12-06-2007, 11:23 AM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
auto eth1
iface eth1 inet static
address 192.168.J.J
netmask 255.255.255.0
network 192.168.J.0
broadcast 192.168.J.255
gateway 192.168.J.1

...

The router become 192.168.H.5
What's all this "H" and "J" stuff? You cannot have letters in IP addresses!
Did you read any of that tutorial / howto I linked to in post #3? Yuo cannot expect anything to work if you do not do a little reading.
IPV4 numbers are in the form x.x.x.x where x is between 0 and 255

So, set your router to be 192.168.0.1
Then try this in your interfaces file:



Code:
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1

auto eth1
iface eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
(Note that there should be something about your lo interface at the start of the interfaces file - do not change that part)

Then bring the interfaces down, and back up again:
sudo ifdown eth0
sudo ifdown eth1
sudo ifup eth0
sudo ifup eth1

So now what does ifconfig say?
Can you ping your router?
ping 192.168.0.1

Edit: Why don't you just stick with one ethernet connection, to your router, to start with? Use eth0 and unplug eth1 until we get this sorted.
/Edit

Last edited by tredegar; 12-06-2007 at 11:31 AM.
 
Old 12-06-2007, 01:43 PM   #12
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Networking missunderstood

Hi there

Thanks for the help, let me tell you that I'm not lazy and I've read a lot of this subjetc.

I did it like you told and my question it's only one.
With this configuration can I have one ehternet for local area network and another for internet ?

My schematics goes something like this

Internet (router) 192.168.0.1
|
| (connecting to eth0)
Ubuntu Box
|
| (connections going from eth0 & eth1)
|
L Computer #1 (directly connected to Ubuntu, eth1)
|
L Computer #2 (directly connected to Ubuntu, eth1)

http://ubuntuforums.org/showthread.php?t=89320

Quote:
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1

auto eth1
iface eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
 
Old 12-06-2007, 04:33 PM   #13
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
"Something like" is not good enough. Sorry.
Quote:
Internet (router) 192.168.0.1
|
| (connecting to eth0)
Ubuntu Box
|
| (connections going from eth0 & eth1)
|
L Computer #1 (directly connected to Ubuntu, eth1)
|
L Computer #2 (directly connected to Ubuntu, eth1)
You cannot have two computers connected to eth1 without a router / switch being involved. It is not physically possible: One socket, but two PCs: It will not work. Just try jamming two cables into one socket. See?

Please, take a step back. Pause, take a deep breath and think a little. You are making life unnecessarily complicated for yourself:
You have a router. (How many Ethernet ports does it have? (usually 4 as a minimum))

Set it up like this (Bad ASCII art follows ):
Code:
             Your WAN (INTERnet) IP may be          These are your LOCAL LAN Addresses
             Something like 82.144.99.7             |
             I just guessed a random number, sorry  |
             if this is someone's real IP(!)        |
                      |                             V
                      |
                      |                |---PC1 (192.168.0.2)
                      |                |
                      |                |---PC2 (192.168.0.3)
                      |                |
Internet---ISP---DSL---Modem--Router---|---PC3 (192.168.0.4)
                                 |     |
                                 |     |---PC4 (192.168.0.5)
                                 |
                                 |
                                 |
                   Your Modem /router has 2 addresses
           One is external (eg 82.144.99.7) referenced by the INTERnet
                     and allocated by your ISP
            The other is LOCAL (192.168.0.1) referenced by your LAN
Then the router will then sort the connections for you

PC1, PC2 etc have IP numbers as in the diagram.

They have these (LAN) IP numbers because you have specified them in each of the PCs interfaces file, like this:


Code:
[Snip]
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
[Snip]
The red bit you will have to change according to each PC you are setting up. Each PC needs a different IP address, within your subnet range (EG 192.168.0.*), and a different hostname if you wish to refer to them by name rather than IP number (most of us prefer this)

If you want to refer to them by hostname, then you'll have to rename your hosts one at a time to a unique name other than "localhost" [See the file /etc/hostname and man hostname], and then reboot them (hostname changes are fundamental to the operation of your OS).

Then you'll have to list your local, LAN hosts, in all the PC's /etc/hosts files, these should all be identical, something like this:

Code:
# The next line, referring to localhost is essential
127.0.0.1 localhost

# Here are your PCs LAN IP addresses, their FQDNs and shortnames
# Because this is your LOCAL LAN, the names "mynet.me" do not matter, 
# choose anything, but be consistent
192.168.0.2 PC1.mynet.me   PC1
192.168.0.3 PC2.mynet.me   PC2
192.168.0.4 PC3.mynet.me   PC3
192.168.0.5 PC4.mynet.me   PC4
To test it:
Can you ping by IP address eg
ping 198.162.0.1 (Your router)
No? Then your PC is not seeing your router. This is bad.
ping 192.168.0.3 (another PC on your LAN)
No? Then your 192.168.0.3 is not being seen by your LAN/Router. It needs reconfiguring.
Can you ping by hostname eg
ping PC2
No? Then you have a fault with /etc/hosts on the PC you are sat at

Meanwhile, you did not answer my question:
Quote:
Did you read any of that tutorial / howto I linked to in post #3?
So I suppose that means you did not.
Enough from me, get busy reading, googling and experimenting. I'm tired

Last edited by tredegar; 12-06-2007 at 04:36 PM.
 
Old 12-09-2007, 02:51 PM   #14
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Try to explain

Thanks tredegar,

But I think I can't make me understood.
What I want to do it's something like this (not connecting router and 4 pc to their ports but something like this.
Code:
             Your WAN (INTERnet) IP may be          These are your LOCAL LAN Addresses
             Something like 82.144.99.7             |
             I just guessed a random number, sorry  |
             if this is someone's real IP(!)        |
                      |                             V
                      |
                      |                            |---PC1 (192.168.2.3)
                      |                            |
                      |               (192.168.0.1)|---PC2 (192.168.2.4)
                      |                |eth0       |
Net---ISP---DSL----Modem/Router--Linux-   |      |-|---PC3 (192.168.2.5)
                                Server |eth1---- |
                                      (192.168.2.2)|---PC4 (192.168.2.6)
What I want to make it's a configuration like this.

All internet traffic goes to eth0 on linux server.

Eth0 connects to Eth1 via a route (route add -net 192.168.0.1 gw 192.168.2.2)

Eth1 controls local area traffic.

Then all network computers have internet traffic.

The schematic that you represent above it's a "direct connection" to the router, that schematic I Have now for the moment but I want to implement another management way.

Last edited by LMSSML; 12-09-2007 at 02:56 PM.
 
Old 12-10-2007, 04:15 AM   #15
LMSSML
Member
 
Registered: Nov 2007
Distribution: Ubuntu Server and Desktop
Posts: 41

Original Poster
Rep: Reputation: 15
Cool Trying again

Hi people

There's anyone could help me ?

With this situation ?

Best Regards.
 
  


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
Fedora C2 - Wireless network drivers? Broadcom 802.11g Network Adapter FragTek Linux - Wireless Networking 7 01-22-2010 12:10 AM
LXer: Network World names Zenoss Clear Choice for Network Management LXer Syndicated Linux News 0 06-20-2007 08:01 AM
In FC6 network interface doesn't come up if 'service network restart' command is run rajat Linux - Networking 2 05-02-2007 11:53 PM
Debian 3.1r0a, Realtek RTL-8169 network controller slow on network mvr853 Linux - Networking 0 07-21-2006 08:20 PM
3c905C network card in docking station. Cannot activate network device eth0. pathelms Linux - Networking 4 04-12-2006 02:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:42 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