Linux Routing Configuration: Difference between revisions
Jump to navigation
Jump to search
Line 23: | Line 23: | ||
=Routing Configuration that Survives Reboot= | =Routing Configuration that Survives Reboot= | ||
Add the routing configuration to <tt>/etc/sysconfig/network-scripts/route-<device-name></tt>: | Add the static routing configuration to <tt>/etc/sysconfig/network-scripts/route-<device-name></tt>: | ||
<pre> | <pre> | ||
... | |||
# default multicast route | # default multicast route | ||
224.0.0.0/4 via | 224.0.0.0/4 via 172.20.1.12 | ||
</pre> | </pre> | ||
where "172.20.1.12" is the IP address of the interface we want to route the multicast traffic over. | |||
After reboot, we'll get this: | |||
224.0.0.0/4 dev eth1 | <pre> | ||
[eap@app01 ~]$ ip route | |||
... | |||
224.0.0.0/4 via 172.20.1.12 dev eth1 | |||
</pre> |
Revision as of 18:00, 21 March 2017
External
Internal
Adding Multicast Routing to a Specific Network Interface
ip route add 224.0.0.0/4 dev <device-name>
More details about ip can be found here
The equivalent "route" command is:
route add 224.0.0.0 netmask 240.0.0.0 dev <device-name>
Routing Configuration that Survives Reboot
Add the static routing configuration to /etc/sysconfig/network-scripts/route-<device-name>:
... # default multicast route 224.0.0.0/4 via 172.20.1.12
where "172.20.1.12" is the IP address of the interface we want to route the multicast traffic over.
After reboot, we'll get this:
[eap@app01 ~]$ ip route ... 224.0.0.0/4 via 172.20.1.12 dev eth1