nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Static Route oddity

This is a discussion on Static Route oddity within the Networking, Firewalls and Security forums, part of the Mastering Servers category; Hi I have just built an Ubuntu 7.04 Firewall/Gateway and have a very strange static route issue. If I set ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 05-25-2007, 01:43 AM
Junior Member
User
 
Join Date: May 2007
My distro: Debian
Posts: 6
Rep Power: 0
DACTech is on a distinguished road
Default Static Route oddity

Hi

I have just built an Ubuntu 7.04 Firewall/Gateway and have a very strange static route issue.

If I set my Net dev(eth0) to dhcp and add the static route to a location it works.
If I set my Net dev(eth0) to a static IP the static route I am adding doesn't work!!!

my static IP I am giving the eth0 is:
10.1.1.186
netmask 255.255.252.0
gateway 10.1.1.2

the static route I am adding is:
up route add -net 10.1.1.13 netmask 255.255.255.255 gw 10.1.1.125

This static route is going to a BBIagent system that sits in front of a Linux OC3 FTP service and that static route works on all the windows machines.

The fact that is works when I set my eth0 to dhcp tells me it's not a setting in the firewall but possibly a bug in the Ubuntu version? I'm hoping that's not the case.

I'm going to post this on the Ubuntu forums as well but I figured I'd give it a shot here as well.

Thanks for any input and help anyone can give me.

Gary
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-25-2007, 02:09 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Sometime order matters try adding default gw first from shell prompt:
Code:
route add -net default gw 10.1.1.2 dev eth0 
  route add -net 10.1.1.13 netmask 255.255.255.255 gw 10.1.1.125
route -n
If it works with DHCP it *should* work with static settings. Hint: when you see it working with DHCP just look at routing table
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 05-25-2007, 03:38 AM
Junior Member
User
 
Join Date: May 2007
My distro: Debian
Posts: 6
Rep Power: 0
DACTech is on a distinguished road
Default

Unfortunately that didn't work either.

Here's the route -n and ip route show info for when it's DHCP and working.

$ sudo route -n

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.1.1.13 10.1.1.125 255.255.255.255 UGH 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.1.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth1
0.0.0.0 10.1.1.2 0.0.0.0 UG 0 0 0 eth0

$ sudo ip route show

10.1.1.13 via 10.1.1.125 dev eth0
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
10.1.0.0/22 dev eth0 proto kernel scope link src 10.1.2.70
169.254.0.0/16 dev eth1 scope link metric 1000
default via 10.1.1.2 dev eth0

Let me reboot with static and I'll get the same info and see if there's any difference that I can see or you can see.

OK..heres the same info but when I have it set to a static IP address

$ sudo route -n

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.1.1.13 10.1.1.125 255.255.255.255 UGH 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.1.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 10.1.1.2 0.0.0.0 UG 0 0 0 eth0

sudo ip route show

10.1.1.13 via 10.1.1.125 dev eth0
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
10.1.0.0/22 dev eth0 proto kernel scope link src 10.1.1.186
169.254.0.0/16 dev eth0 scope link metric 1000
default via 10.1.1.2 dev eth0


Thanks for the quick response as well! Greatly appreciated!


Gary

Last edited by DACTech; 05-25-2007 at 03:43 AM..
Reply With Quote
  #4 (permalink)  
Old 05-25-2007, 04:16 AM
Member
User
 
Join Date: Jun 2005
Posts: 78
Rep Power: 0
jerry
Default

Routing table looks same for both DHCP and Static config. Did ya enable packet forwarding for IPv4???
Code:
sysctl net.ipv4.ip_forward
If not set it to 1:
Code:
sudo sysctl net.ipv4.ip_forward=1
You may also need to play with iptables:
Code:
sudo iptables -L -n | less
If not remove old iptables add just routing (adjust interface):
Code:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
Make sure you have correct dns servers in /etc/resolv.conf
Code:
more /etc/resolv.conf
nameserver 208.67.222.222
nameserver 208.67.220.220

Finally ping to your ISP router and namesever
Code:
ping 208.67.222.222
Can you ping via IP but not via domain? look for DNS
Can you ping to your ISP router but not to any other host on internet/intranet? look for firewall

Last edited by jerry; 05-25-2007 at 04:20 AM..
Reply With Quote
  #5 (permalink)  
Old 05-25-2007, 04:24 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Before
169.254.0.0/16 dev eth1 scope link metric 1000


After
169.254.0.0/16 dev eth0 scope link metric 1000

Please use correct routing commands.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #6 (permalink)  
Old 05-25-2007, 07:39 AM
Junior Member
User
 
Join Date: May 2007
My distro: Debian
Posts: 6
Rep Power: 0
DACTech is on a distinguished road
Default

Funny thing is that I didn't change anything in that regards. I did notice that after I posted my routing tables!

Why would the system change that just by changing the eth0 configuration from dhcp to static?

I've tried to delete it but it keeps coming back! Where can I change that manually?

Jerry

All DNS, IP4 forwarding is set properly. I will look into the IP Tables like you suggested!

This forum is really nice to be in! Glad I found it!

I took off early from work as my brain was a bit in a mush state from dealing with multiple head scratchers today!

I'll try everything tomorrow.

Again, thanks for you help on this one.

Gary
Reply With Quote
  #7 (permalink)  
Old 05-25-2007, 11:09 PM
Junior Member
User
 
Join Date: May 2007
My distro: Debian
Posts: 6
Rep Power: 0
DACTech is on a distinguished road
Default

Seems as though it's the avahi-autoipd.action doing this.

Anyone know how to properly manipulate this action to ignore this?

Gary

P.S..thanks for dealing with my limited knowledge of Linux. I'm learning it as I go here! As if that wasn't obvious
Reply With Quote
  #8 (permalink)  
Old 05-25-2007, 11:27 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

can you paste your /etc/network/interfaces file so that I can see what modification you have made so far for static setup..??

On a related note you can use GUI tool much simple and easy to use. Goto System > Administrator > Network; see if you can fix everything using GUI much easier than playing with config file. Make all modification save everything and just reboot system
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #9 (permalink)  
Old 05-26-2007, 01:02 AM
Junior Member
User
 
Join Date: May 2007
My distro: Debian
Posts: 6
Rep Power: 0
DACTech is on a distinguished road
Default

I'm reinstalling to 6.10 Edgy and will try it from there as I have a feeling it's something with the new 7.04 Feisty Fawn build that's doing it.

Read this:
Wired Networking Woes - Ubuntu Forums

I'll let you know once 6.10 is up and configured.

Gary
Reply With Quote
  #10 (permalink)  
Old 05-26-2007, 11:59 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by DACTech View Post
I'm reinstalling to 6.10 Edgy and will try it from there as I have a feeling it's something with the new 7.04 Feisty Fawn build that's doing it.

Read this:
Wired Networking Woes - Ubuntu Forums

I'll let you know once 6.10 is up and configured.

Gary
I'm not surprised with this bug, latest version is for desktop usage. Always run stable system on server/firewall. Hope old version sort out your isssue
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
No route to host csvinayak Linux hardware 8 04-07-2008 06:44 PM
No Route to Host zakaferoz Mail Servers 1 11-18-2007 09:20 AM
Static ip address in Ubuntu Linux howto raj Networking, Firewalls and Security 0 01-18-2007 04:18 AM
Default Route puppen Linux software 2 04-27-2006 12:33 AM
Static Route in Linux, permanent puppen Linux software 3 04-13-2006 10:06 PM


All times are GMT +5.5. The time now is 03:34 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36