Networking Forums

Networking Forums > Computer Networking > Linux Networking > RH9 default route

Reply
Thread Tools Display Modes

RH9 default route

 
 
Fabio C.
Guest
Posts: n/a

 
      04-09-2004, 08:48 AM
Dears,
in attempt to configure a RH9 machine as proxy-filtering server, I
can't figure how to write /etc/sysconfig/* files for setup the right
default gateway and default gateway device on boot.

The machine has two ethernet nics:

eth0 Link encap:Ethernet HWaddr 00:80:5F:C7:7D:53
inet addr:10.47.0.107 Bcast:10.47.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1753462 errors:41 dropped:0 overruns:0 frame:41
TX packets:256949 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:825196544 (786.9 Mb) TX bytes:22559469 (21.5 Mb)
Interrupt:9 Base address:0x3800

eth1 Link encap:Ethernet HWaddr 000:B7:69:26:9B
inet addr:10.47.20.107 Bcast:10.47.20.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:974055 errors:0 dropped:0 overruns:0 frame:0
TX packets:53679 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:188098720 (179.3 Mb) TX bytes:3537363 (3.3 Mb)
Interrupt:5 Base address:0x2000 Memory:c6cfe000-c6cfe038


eth0 is the inside interface listening for private subnets traffic,
while eth1 provides the internet access.

This is the actual and RIGHT routing table:

10.47.0.0/24 dev eth0 scope link
172.18.0.0/16 via 10.47.0.1 dev eth0
172.19.0.0/16 via 10.47.0.1 dev eth0
169.254.0.0/16 dev eth1 scope link
172.17.0.0/16 via 10.47.0.1 dev eth0
10.47.0.0/16 dev eth1 scope link
192.168.0.0/16 via 10.47.0.1 dev eth0
10.0.0.0/8 via 10.47.0.1 dev eth0
127.0.0.0/8 dev lo scope link
default via 10.47.0.1 dev eth1 <<<

NOTE: although eth0 is the 10.47.0.0/24 interface, all the traffic not
concerning to the specified routes (0.0.0.0) must pass via 10.47.0.1
THROUGH the eth1 device.

All is working fine, the final step is to configure RedHat's files to
bring up the current routing table on boot.

FYI, I pasted the content of the interested files below:


# cd /etc/sysconfig/network-scripts

# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
BROADCAST=10.47.0.255
IPADDR=10.47.0.107
NETMASK=255.255.255.0
NETWORK=10.47.0.0
GATEWAY=10.47.0.1
TYPE=Ethernet
USERCTL=no
PEERDNS=yes

# cat ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
BROADCAST=10.47.20.255
IPADDR=10.47.20.107
NETMASK=255.255.0.0
NETWORK=10.47.0.0
GATEWAY=10.47.0.1
TYPE=Ethernet
USERCTL=no
PEERDNS=yes

# cat route-eth0
172.18.0.0/16 via 10.47.0.1 dev eth0
172.19.0.0/16 via 10.47.0.1 dev eth0
172.17.0.0/16 via 10.47.0.1 dev eth0
192.168.0.0/16 via 10.47.0.1 dev eth0
10.0.0.0/8 via 10.47.0.1 dev eth0

# cat ../network
NETWORKING=yes
HOSTNAME=as-lnx07.benetton.org
GATEWAYDEV=eth1
GATEWAY=10.47.0.1

Although the last file is configured to bring up the default gateway
through the device eth1, /etc/init.d/network bgrings it up to the device
eth0.

I really could not believe about the complexity of those startup
scripts, and really, this is the first time I ask on usenet for such a
stupid question, but Internet this time did not help too much.

Could anybody help me?


Thanks in advance.
Fabio
 
Reply With Quote
 
 
 
 
Antoine EMERIT
Guest
Posts: n/a

 
      04-10-2004, 10:05 PM
"Fabio C." <(E-Mail Removed)> wrote
news:c55o1k$skm$(E-Mail Removed):
> eth0 Link encap:Ethernet HWaddr 00:80:5F:C7:7D:53
> inet addr:10.47.0.107 Bcast:10.47.0.255
> Mask:255.255.255.0
> eth1 Link encap:Ethernet HWaddr 000:B7:69:26:9B
> inet addr:10.47.20.107 Bcast:10.47.20.255
> Mask:255.255.0.0


> default via 10.47.0.1 dev eth1 <<<

????

> NOTE: although eth0 is the 10.47.0.0/24 interface, all the traffic not
> concerning to the specified routes (0.0.0.0) must pass via 10.47.0.1
> THROUGH the eth1 device.


??? it shouldn't be "default via 10.47.0.1" and "eth1" ???!!!

For the other lan stations, the default route is 10.47.0.1 and the
network traffic pass throw the eth1 nic, but for this box, the default
route should be your provider gateway ip and go throw et0.

> # cat ifcfg-eth0
> DEVICE=eth0
> BOOTPROTO=static
> ONBOOT=yes
> BROADCAST=10.47.0.255
> IPADDR=10.47.0.107
> NETMASK=255.255.255.0
> NETWORK=10.47.0.0
> GATEWAY=10.47.0.1

GATEWAY=<isp gateway> or nothing if automatically seted
> TYPE=Ethernet
> USERCTL=no
> PEERDNS=yes
>
> # cat ifcfg-eth1
> DEVICE=eth1
> BOOTPROTO=static
> ONBOOT=yes
> BROADCAST=10.47.20.255
> IPADDR=10.47.20.107
> NETMASK=255.255.0.0
> NETWORK=10.47.0.0

NETWORK=10.47.20.0
> GATEWAY=10.47.0.1

GATEWAY=<isp gateway> or nothing if automatically seted
> TYPE=Ethernet
> USERCTL=no
> PEERDNS=yes
>
> # cat route-eth0
> 172.18.0.0/16 via 10.47.0.1 dev eth0
> 172.19.0.0/16 via 10.47.0.1 dev eth0
> 172.17.0.0/16 via 10.47.0.1 dev eth0
> 192.168.0.0/16 via 10.47.0.1 dev eth0

You don't have any nic attached on theses networks (but it should work
anyway) ?

> 10.0.0.0/8 via 10.47.0.1 dev eth0

No need ?

> # cat ../network
> NETWORKING=yes
> HOSTNAME=as-lnx07.benetton.org
> GATEWAYDEV=eth1
> GATEWAY=10.47.0.1

Your ips gateway ip, or your isp given (public?) ip.

> Although the last file is configured to bring up the default gateway
> through the device eth1, /etc/init.d/network bgrings it up to the
> device eth0.


Because the ip is not matching the device.

Try with 10.47.20.1 as the gateway (on this box only).


Hope it may help


Regards
 
Reply With Quote
 
Fabio C.
Guest
Posts: n/a

 
      04-14-2004, 12:07 PM
Antoine EMERIT wrote:
>>eth0 Link encap:Ethernet HWaddr 00:80:5F:C7:7D:53
>> inet addr:10.47.0.107 Bcast:10.47.0.255
>> Mask:255.255.255.0
>>eth1 Link encap:Ethernet HWaddr 000:B7:69:26:9B
>> inet addr:10.47.20.107 Bcast:10.47.20.255
>> Mask:255.255.0.0

>
>
>>default via 10.47.0.1 dev eth1 <<<

>
> ????


eth1 has enough visibility to reach 10.47.0.1 which is the default
gateway that routes packets only from eth1's source address.

>>NOTE: although eth0 is the 10.47.0.0/24 interface, all the traffic not
>>concerning to the specified routes (0.0.0.0) must pass via 10.47.0.1
>>THROUGH the eth1 device.

>
>
> ??? it shouldn't be "default via 10.47.0.1" and "eth1" ???!!!


(from iproute's help)

NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS

> For the other lan stations, the default route is 10.47.0.1 and the
> network traffic pass throw the eth1 nic, but for this box, the default
> route should be your provider gateway ip and go throw et0.


Internet access is managed by our border routers which provide IP
forwarding. All is working fine, all I need is only to know how RedHat's
scripts catch those type of informations, without having to add my
routes to /etc/rc.local which is not a brilliant solution.

> GATEWAY=<isp gateway> or nothing if automatically seted


Read above.

> NETWORK=10.47.20.0


Netmask is 255.255.0.0, should I care?

> GATEWAY=<isp gateway> or nothing if automatically seted


Again, read above.

> You don't have any nic attached on theses networks (but it should work
> anyway) ?


It's all working fine, I repeat, it's only a boot script problem.

[cut]

> Because the ip is not matching the device.
>
> Try with 10.47.20.1 as the gateway (on this box only).


What would it mean that the IP is not matching the device?
eth1 has /16 as metric that's enough to reach 10.47.0.1, infact all is
working perfectly.

What I only need is to know how should I configure the sysconfig stuff
to bring back all the routes after shutdown or reboot.

P.S.: I would usually call "box" the place where I put my car, not a
server. (j/k)


Kind regards,
Fabio
 
Reply With Quote
 
 
 
Reply

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
default route ignored when ppp0 up Don Linux Networking 10 05-01-2012 03:49 PM
cannot set the default route in a rh9 box Monroe_Buffalo Linux Networking 2 11-11-2005 06:43 PM
Redundancy with second default route David Linux Networking 1 10-13-2003 05:20 PM
dhcp default route JA Linux Networking 1 09-13-2003 03:13 AM
Default route - help... Adam Linux Networking 1 07-08-2003 01:23 PM



1 2 3 4 5 6 7 8 9 10 11