LinuxQuestions.org
Review your favorite Linux distribution.
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 11-10-2006, 12:10 PM   #1
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 38
Problems configuring Ubuntu as a gateway


I've set up an old PC as per the instructions here, but i can't get it to connect to my ISP (blueyonder).

My /etc/network/interfaces file is currently:

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0 eth1
iface lo inet loopback

# The primary network interface
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        pre-up iptables-restore < /etc/iptables.up.rules
#       gateway 192.168.0.1
#       dns-nameservers 192.168.0.1
        # dns-* options are implemented by the resolvconf package, if installed

#Outgoing internet connection
iface eth1 inet dhcp
I don't know which properties to put under the eth1 connection, and blueyonder (my ISP) don't seem to know either.

Any ideas?
 
Old 11-10-2006, 06:35 PM   #2
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,682
Blog Entries: 9

Rep: Reputation: 45
Quote:
Originally Posted by Lordandmaker
I've set up an old PC as per the instructions here, but i can't get it to connect to my ISP (blueyonder).

My /etc/network/interfaces file is currently:

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0 eth1
iface lo inet loopback

# The primary network interface
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        pre-up iptables-restore < /etc/iptables.up.rules
#       gateway 192.168.0.1
#       dns-nameservers 192.168.0.1
        # dns-* options are implemented by the resolvconf package, if installed

#Outgoing internet connection
iface eth1 inet dhcp
I don't know which properties to put under the eth1 connection, and blueyonder (my ISP) don't seem to know either.

Any ideas?
Well maybe I'm missing something here. Why would you want to have two listings? Does the PC have two NIC cards ?

Oh and it's a complete waste of time discussing Linux type stuff with nearly all ISP's their call centre muppets are only trained to answer things from windows script cards.

I normally just have to provide the IP for the pc e.g. 10.0.0.2, the netmask e.g. 255.255.255.0 (you might have to use something different, but thats pretty common), the gateway IP - obviously the IP range is usually the same as the range for the pc NIC, maintaining the above example say, the router/modem might be 10.0.0.1 - and the dns server are whatever you will have been provided by blueyonder (there might be something on their help page if you don't have the numbers).

My example is how I'd do this with static IP addresses - if blueyonder only provide DHCP address then it might depend on the distro how you'd set it up.

My aunt uses ntl and her Kubuntu install just recognised both her NIC and the necessary configuration to connect to the modem (not sure if it's a router/modem device) that they supplied for her connection (she's in her early 80's so one of their techies installed the connection for her windows install).

regards

John
 
Old 11-10-2006, 08:59 PM   #3
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Your setup looks correct, assuming that your ISP gives you a DHCP address, and that 192.168.0.2 should be the correct IP address for your LAN. If that is not the case, then you certainly have a problem.

Something else worth checking, is are you sure that eth0 is connected to the LAN, and eth1 is connect to the cable/dsl modem? If you have them cross wired, you won't get internet at all.

Peace,
JimBass
 
Old 11-11-2006, 04:13 AM   #4
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,682
Blog Entries: 9

Rep: Reputation: 45
Quote:
Originally Posted by JimBass
Your setup looks correct, assuming that your ISP gives you a DHCP address, and that 192.168.0.2 should be the correct IP address for your LAN. If that is not the case, then you certainly have a problem.

Something else worth checking, is are you sure that eth0 is connected to the LAN, and eth1 is connect to the cable/dsl modem? If you have them cross wired, you won't get internet at all.

Peace,
JimBass
Ha ha! well done JimBass I'd forgotten that the IP address quoted by Lordandmaker looks very much like the default one for an install - rather than one thats been set by the admin/user.

Not using a cable ISP, I could only guess with my suggestion. I'm no ones expert.

I was wondering though, because I seem to recall that when I installed my aunt's Kubuntu, it also seemed to want to configure eth0 and eth1, but I suspect that that was more to do with her system i.e. with ethernet and firewire networking connections.

Plus, because Lordandmaker hasn't said which distro is used, I/we can't suggest any possible distro specific hints/tips.

regards

John
 
Old 11-11-2006, 04:35 AM   #5
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally Posted by Lordandmaker
I've set up an old PC as per the instructions here, but i can't get it to connect to my ISP (blueyonder).

My /etc/network/interfaces file is currently:

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0 eth1
iface lo inet loopback

# The primary network interface
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        pre-up iptables-restore < /etc/iptables.up.rules
#       gateway 192.168.0.1
#       dns-nameservers 192.168.0.1
        # dns-* options are implemented by the resolvconf package, if installed

#Outgoing internet connection
iface eth1 inet dhcp
I don't know which properties to put under the eth1 connection, and blueyonder (my ISP) don't seem to know either.

Any ideas?
If this is a standalone box and is not doing NAT routing and sharing for other boxes then you need to configure the network on the same subnet as the modem/router. It seems that you are doing NAT routing if you are using 2 ethernet cards. In this case the internal network (LAN) needs to be on a different subnet.
In the above instance the lan subnet appears to be in the range 192.168.0.0/255. The router must not use the same subnet. Lets say the router uses 192.168.1.0/255 and the router address is 192.168.1.1. This box's gateway will be 192.168.1.1. You need to configure eth1 to automatically pickup a lease so you need to add the line;

auto eth1

above the iface line to pick up the lease. Remember to restart networking (/etc/init.d/networking restart) If you have other boxes behind this accessing the net then you need ip-masquerading iptables rules implemented and their interfaces file should use 192.168.0.2 as the gateway. You should also add a line;
auto eth0
for the LAN config.
If this has confused you even more then let me know.

Last edited by TigerOC; 11-11-2006 at 04:44 AM.
 
Old 11-11-2006, 10:17 AM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Nice, TigerOC, I didn't notice that they had the auto lo eth0 eth1 in the wrong place. That certainly could be the cause of the problem. Interesting though - did the installer put that line there? I don't think it would have. All my multi nic servers always have the auto ethX line just above that card's info.

To BigJohn, it actually never crossed my mind that that address might be the result of a default install. I thought all interfaces defaulted to DHCP, and if you tell it you want a static, it doesn't default to anything. What suprised me was that specific address, 192.168.0.2. It seems if you are making your linux box a router, you'd want it either to be the highest or lowest address available for use, 192.168.0.1 or 192.168.0.254. Of course you can make your gateway/router have any address in the subnet without a problem, but seeing 192.168.0.2 suggests something else might be 192.168.0.1 (which is the default address for countless numbers of linksys routers). I though maybe our OP was trying to setup a LAN with 2 routers, which would probably make him really unhappy when he found that each segment behind seperate routers don't interact well.

And also sir, anyone with 2000+ posts counts as an expert in my book!

Peace,
JimBass
 
Old 11-11-2006, 08:25 PM   #7
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,682
Blog Entries: 9

Rep: Reputation: 45
Quote:
Originally Posted by JimBass
-----%<-----
And also sir, anyone with 2000+ posts counts as an expert in my book!

Peace,
JimBass
Ha ha! not all the time my arse points downwards my friend!

regards

John
 
Old 11-14-2006, 10:06 AM   #8
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Original Poster
Rep: Reputation: 38
Wooo, sorry it took so long to get back to you guys. Uni decided it wanted me to work and all...

Firstly, it's Ubuntu 6.06. I meant to mention that, but somehow managed to forget. On install, it only tried to configure one NIC. Since i have no DHCP server (disabled on the router), i had to do it manually. Though the LAN works fine.

The 192.168.0.2 setting is there from it acting as a webserver behind my router (which is at .0.1) and so that it kept an IC for when i was grabbing packages during installation. The current router's off (as are all client machines aside from my static IP desktop) when i'm testing this.

According to my ISP, i get my IP through DHCP, and as i said they can't give me any more info as to any other settings I need.

I'm sure that eth0 is the LAN and eth1 is pointing outside because i can ifdown eth1 and still ping LAN clients.


TigerOC - I *think* i've got what you mean. But i'm not entirely sure.
Either way, i'll boot that box up now and have another play with it...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Configuring a Gateway using Slack tubatodd Slackware 91 06-16-2006 11:02 PM
Need Help Configuring Linux 9 As gateway rml_85226 Linux - Networking 5 05-18-2006 12:36 AM
Configuring Fedora 3 as an internet gateway justiceisblind Fedora 1 05-27-2005 01:42 PM
configuring gateway - help jhar Linux - Newbie 6 01-30-2005 09:54 AM
configuring openbsd 3.3 pppoe gateway yocompia *BSD 3 09-28-2003 02:11 PM


All times are GMT -5. The time now is 03:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration