Ask Your Question
1

Configuring Static Routes

asked 2012-02-17 08:23:36 -0500

Roger gravatar image

updated 2012-02-22 05:18:21 -0500

Hi all,

I need configure my VM with static route

Following the guide

I create the /etc/sysconfig/network-scripts/route-eth0 file with the content

default 172.16.16.2 dev eth0
172.16.0.0/16 via 172.16.16.2 dev eth0
169.254.0.0/16 via 172.16.16.2 dev eth0

When I restart the network, I still without internet access in my box

Any idea?

Update

[root@ol56-oim9-db ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
172.16.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
[root@ol56-oim9-db ~]#

network card

[root@ol56-oim9-db ~]# dmesg | grep eth
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
e1000: eth0 NIC Link is Down
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
e1000: eth0 NIC Link is Down
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None

Disable the script

[root@ol56-oim9-db ~]# mv /etc/sysconfig/network-scripts/route-eth0 route-eth0-bak
[root@ol56-oim9-db ~]# service network restart
Shutting down interface eth0:  [  OK  ]
Shutting down loopback interface:  [  OK  ]
Bringing up loopback interface:  [  OK  ]
Bringing up interface eth0:  [  OK  ]

try add manually

[root@ol56-oim9-db ~]# route add -net 172.16.0.0/16 gw 172.16.16.2
[root@ol56-oim9-db ~]# route add -net 169.254.0.0/16 gw 172.16.16.2
[root@ol56-oim9-db ~]# ping www.google.com
connect: Network is unreachable

try add manually - 2

[root@ol56-oim9-db ~]# route add default gw 172.16.16.2
[root@ol56-oim9-db ~]# ping www.google.com
PING www.l.google.com (74.125.234.115) 56(84) bytes of data.
64 bytes from gru03s08-in-f19.1e100.net (74.125.234.115): icmp_seq=1 ttl=128 time=9.22 ms
64 bytes from gru03s08-in-f19.1e100.net (74.125.234.115): icmp_seq=2 ttl=128 time=8.57 ms
64 bytes from gru03s08-in-f19.1e100.net (74.125.234.115): icmp_seq=3 ttl=128 time=11.5 ms
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-02-20 10:10:39 -0500

ZenDark gravatar image

updated 2012-02-20 10:11:05 -0500

Are you sure your network interface is named "eth0"??

To test that your routes are correct, try adding them from console:

route add -net 172.16.0.0/16 gw 172.16.16.2
route add -net 169.254.0.0/16 gw 172.16.16.2

If they are correct, remove them and execute:

/etc/sysconfig/network-scripts/ifup-routes eth0

that will add the routes defined in your route-eth0.

edit flag offensive delete link more
0

answered 2012-04-17 14:36:16 -0500

BCD3 gravatar image

I had the same static route problem. My instance of Fedora 16 is a guest on a VirtualBox implementation in Windows 7. I use bridging to the host adapter and have created the route-p2p1 (p2p1 is my network interface id within the guest environment) with the following: ADDRESS0=172.18.1.0 NETMASK0=255.255.255.0 GATEWAY0=10.9.1.15

and I still had to manually configure the route once fedora was up and running.

When I added the route with the Network configuration tool in the System Settings application, the following files were created in /etc/sysconfig/network-scripts: route-Wiredconnection1 ifcfg-Wiredconnection1

I copied the ifcfg-Wiredconnection1 to ifcfg-p2p1, fixed the 'NAME' parameter, deleted the UUID and rebooted the machine and the problem was solved. Apparently there has to be a properly configured ifcfg file associated with the network interface.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-02-17 08:23:36 -0500

Seen: 19,836 times

Last updated: Apr 17 '12