Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-10-2003, 02:29 PM   #1
Paul Woodhouse
LQ Newbie
Registered: Nov 2003
Posts: 6

Rep: Reputation: 0
Question How do I get iptables to redirect my default gateway address?


I have a Red Hat Linux pc set up, dual booting with 2003. Now, 2003 connects to internet over dsl no probs. Linux is another matter. I set it up as follows.

My pcs all have an address of
IP: 217.155.x.x.


yeah yeah i know, terrible setup! its the only way i could get this crap router to work with my 8ip block from isp though. because the routers address is assinged to the ppp0a port. it won't let me assign it to eth0 as well, rediculous situation i think you'll agree. let be go though it again.

As far as i can see linux must calculate the subnet for the default gateway as and therefore can't access it, windows i assume uses the subnet for the configured ip address, and therefore doesn't have a problem.

Is there a solution to make linux work in this setup? It was suggestted in my orginal thread that i need to use iptables. Is this correct? if so how do i proceed?


Old 11-11-2003, 01:29 AM   #2
Registered: Aug 2003
Posts: 36

Rep: Reputation: 15
Why don't you just install DHCPd?
And at the DHPDd config file you can add a line like "option-router"
OR you have to add the gateway-address by hand
Old 11-11-2003, 08:20 AM   #3
Paul Woodhouse
LQ Newbie
Registered: Nov 2003
Posts: 6

Original Poster
Rep: Reputation: 0
sorry i'm a bit of a linux newbie! how would i go about doing this.


Old 11-11-2003, 08:52 AM   #4
Registered: Aug 2003
Posts: 36

Rep: Reputation: 15
Well.. I'm a newbie too (I just already solved this question)
You'll have to get DHCP from
Just install it and edit the DHCPd.conf file in /etc/dhcpd.conf

# Example /etc/dhcpd.conf.... You'll have to edit this yourself
ddns-update-style ad-hoc;
default-lease-time 1200;
max-lease-time 9200;
option subnet-mask;
option broadcast-address;
option routers;
option domain-name-servers ******;
#option domain-name "";
subnet netmask {


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
How do I set the ip address for eth0, eth1 and the default gateway? abefroman SUSE / openSUSE 5 05-19-2005 04:15 AM
Universal default gateway address resolution otisthegbs Linux - Networking 2 07-09-2004 02:28 AM
Obtaining a default gateway IP address from a Win2K workstation Linh Programming 1 02-20-2004 02:55 AM
odd default gateway address, uses addr ~.ip.~ whatzat? piratebiter Linux - Networking 0 09-07-2003 07:06 PM
e-mail address redirect? WorldBuilder Linux - Networking 6 05-18-2003 09:15 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration