nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Networking, Firewalls and Security No it's not a secret. Talk about firewalls and security issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 25-05-2007, 12:43 AM
Junior Member
User
 
Join Date: May 2007
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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
  #2 (permalink)  
Old 25-05-2007, 01:09 AM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
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.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #3 (permalink)  
Old 25-05-2007, 02:38 AM
Junior Member
User
 
Join Date: May 2007
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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; 25-05-2007 at 02:43 AM.
Reply With Quote
  #4 (permalink)  
Old 25-05-2007, 03:16 AM
Senior Member
User
 
Join Date: Jun 2005
Posts: 137
Thanks: 21
Thanked 4 Times in 3 Posts
Rep Power: 5
jerry is on a distinguished road
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; 25-05-2007 at 03:20 AM.
Reply With Quote
  #5 (permalink)  
Old 25-05-2007, 03:24 AM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
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.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #6 (permalink)  
Old 25-05-2007, 06:39 AM
Junior Member
User
 
Join Date: May 2007
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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 25-05-2007, 10:09 PM
Junior Member
User
 
Join Date: May 2007
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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 25-05-2007, 10:27 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
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.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #9 (permalink)  
Old 26-05-2007, 12:02 AM
Junior Member
User
 
Join Date: May 2007
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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 26-05-2007, 10:59 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
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 Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply


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 Off


Similar Threads

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


All times are GMT +5.5. The time now is 01:19 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38