Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-28-2012, 03:39 AM   #1
LQ Newbie
Registered: Mar 2008
Posts: 15

Rep: Reputation: 0
Getting problem in Static Routing in Debian

I am newbie to Linux networking.
I have 2 NICs in Debian host. eth0 is running DHCP and its setting is
allow-hotplug eth0
iface eth0 inet dhcp
eth1 is running in static IP and setting is as below

auto eth1
iface eth1 inet static
eth0 is getting dynamic IP and internet is okay.

I am connecting my Client PC via eth1 having IP Now I need to add proper route. Where and what shall I require to add route in order to access internet service in my Client PC. Is there anything more remaining things to be done.
Old 08-28-2012, 12:13 PM   #2
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,279

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
To enable routing you need to make a command
echo 1 > /proc/sys/net/ipv4/ip_forward
But with your configuration you also need a NAT. Because addresses 192.168.*** will not be routed to Internet, it is for private local networks. For enabling NAT, you need to add iptables rule:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
And FORWARD ACCEPT rules in filter table if you use it. By default, I think, all is accepted - you should change this if you have other connected clients you want to not be routed. These commands need to be executed after every boot, so write them on starting script, for example /etc/rc.local.
1 members found this post helpful.
Old 08-29-2012, 04:01 AM   #3
LQ Newbie
Registered: Mar 2008
Posts: 15

Original Poster
Rep: Reputation: 0

It work fine. Thank you eSelix


internet connection, sharing, static route

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
Dynamic routing isn't done; static routing works for about 2 seconds for wireless gregorian Linux - Networking 7 02-19-2010 07:43 AM
Two interfaces routing problem, Debian, kernel 2.4 clintp Linux - Networking 4 10-31-2008 01:24 AM
Debian 3 NIC static routing table crashsystems Linux - Networking 3 11-09-2006 01:58 AM
Static Routing Problem kewlemer Linux - Networking 3 07-02-2006 06:56 PM
routing problem with 2 static (external) IPs gjmwalsh Linux - Networking 3 05-23-2004 10:17 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration