In the following examples, other routers and non-routing hosts that use the routed routing daemon would be able to interoperate successfully with the routers running gated.
This would be the /etc/inet/gated.conf file for the router volga shown in ``Example internetwork'':
# Turn off unwanted protocols
#
bgp off ;
egp off ;
ospf off ;
#
# Turn on RIPv2
#
rip on {
broadcast ;
interface all version 2 multicast ;
} ;
By default, gated advertises all directly connected networks
so no configuration statements are needed to have it announce the
subnets 172.16.1 and 172.16.2 to each other. As RIP version 1
is the default protocol, it is necessary to turn version 2 on explicitly.
As a more complicated example, assume that routers to other networks exist on the subnet 172.16.1 and that subnet 172.16.2 is a branch of this network through the single router volga. The entries in /etc/inet/gated.conf then need to configure gated to announce routes learned via RIP on subnet 172.16.1:
# Turn off unwanted protocols
#
bgp off ;
egp off ;
ospf off ;
#
# Turn on RIPv2
#
rip on {
broadcast ;
interface all version 2 multicast ;
} ;
#
# Use RIP to announce all routes learn via RIP that are
# available via subnet 172.16.1 to subnet 172.16.2
#
export proto rip interface 172.16.2.1 { # where to announce
proto rip interface 172.16.1.1 { # what to announce
all ; # do not restrict
} ;
} ;
In this example, consider the following /etc/inet/gated.conf
entries for an external gateway that is connected to the internal subnet
172.16.1 on the network 172.16 via an interface
with IP address 172.16.1.12:
# Generate a default route when an EGP neighbor is acquired
#
options gendefault;
#
# Define our Autonomous System ID
#
autonomoussystem 4711 ;
#
# Turn off unwanted protocols
#
bgp off ;
ospf off ;
#
# Turn on RIPv2 multicasting on the local subnet
#
rip on {
broadcast ;
interface 172.16.1.12 version 2 multicast ;
} ;
#
#Turn on EGP
#
egp on {
# Define our EGP neighbors
group {
neighbor 128.212.64.1 ;
neighbor 128.210.60.1 ;
} ;
} ;
#
# Announce the entire 172.16 network using EGP to Autonomous System 519
#
export proto egp as 519 {
proto direct {
172.16.0.0 metric 0 ;
} ;
} ;
#
# Announce the default route out of 172.16 using RIP to 172.16.1.0
#
export proto rip interface 172.16.1.12 {
proto default {
all metric 4 ;
};
};
The following two examples show how gated
can be configured to generate a general route from information
supplied about several more specific routes. The way in which
gated does this in UnixWare is different from in previous
releases. Route aggregation is not performed automatically.
You must configure it explicitly using the aggregate statement
in the
gated.conf(4tcp)
file.
See
``Route aggregation''
for a full description of
route aggregation and the
syntax of the aggregate statement.
This example is for a router with three network interfaces where the two 10 subnets are to be advertised on the 172.16.244 network:
# Router with interfaces 10.0.0.1, 10.65.0.1, and 172.16.244.1
#
rip yes ;
#
# Turn off unused protocols
#
ospf no;
bgp no;
egp no;
#
static {
host 10.0.0.1 gateway localhost retain ;
host 10.65.0.1 gateway localhost retain ;
host 172.16.244.1 gateway localhost retain ;
} ;
#
# Aggregate the 10 net so that both 10.0.0.1 and 10.65.0.1
# are advertised via 172.16.244.1
#
aggregate 10.0.0.0 mask 255.0.0.0 {
proto direct { 10.0.0.0 mask 255.0.0.0; };
};
#
export proto rip {
proto direct { all; };
proto rip { all; };
proto aggregate {
all metric 1;
};
};
The next example shows how a router can aggregate and advertise
a route to two subnetted class B networks:
# Router with interfaces 172.16.4.233, 172.16.246.17 and 172.16.246.33
#
# Subnet 172.16.4/24 has netmask 255.255.255.00
# Subnet 172.16.246.16/28 has netmask 255.255.255.240 (subnetted class B)
# Subnet 172.16.246.32/28 has netmask 255.255.255.240 (subnetted class B)
#
rip yes ;
#
# Turn off unused protocols
#
ospf no;
bgp no ;
egp no ;
#
static {
host 172.16.4.233 gw localhost retain ;
host 172.16.246.17 gw localhost retain ;
host 172.16.246.33 gw localhost retain ;
} ;
#
# Aggregate 172.16.246.0/24 from the directly attached
# subnets 172.16.246.16/28 and 172.16.246.32/28, and
# advertise via 172.16.4.233
#
aggregate 172.16.246.0 mask 255.255.255.0 { # /24
proto direct {
172.16.246.16 mask 255.255.255.240; # /28
172.16.246.32 mask 255.255.255.240; # /28
};
};
#
export proto rip metric 2 {
proto aggregate {
172.16.246.0 mask 255.255.255.0; # /24
};
};