12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Network Configuration—Routing and BridgingBasic Routing—IP ForwardingThe default behavior of a FreeBSD host is only to pick up packets that are destinedfor the same host. In case there are multiple network interfaces installed on the host,the system does not forward traffic between interfaces by default.This behavior is changed by enabling IP forwarding using the sysctl(8) utility:# sysctl net.inet.ip.forwarding=1# sysctl net.inet6.ip6.forwarding=1The above commands will enable forwarding for IPv4 and IPv6 respectively.To make these changes permanent, you can also add the following lines to the/etc/rc.conf file:gateway_enable="YES"ipv6_gateway_enable="YES"By enabling IP Forwarding (routing) between interfaces, the system will pick up allthe packets that have the layer2 destination, (MAC) address of the same host, andwill forward it to an appropriate network interface, according to the system'srouting table.Once the forwarding is enabled, the forwarding behavior can be controlled bymodifying the routing table. This is done using three methods of routing:• Automatic: The system updates routing tables automatically. For example,a route for each "directly connected" network (taken from IP Address andSubnet mask of each interface) will be added to the routing table.• Manual: You can update the routing table using the route(8) utility.• Dynamic: A dynamic routing daemon (e.g. RIP, OSPF, etc)learns routes from peers over the network and updates local routingtable accordingly.The current status and content of the routing table is displayed using eitherroute(8) or netstat(1) utilities.In the IPv4 routing table, the following command line displays its status and content:# netstat -rn -finetRouting tablesInternet:Destination Gateway Flags Refs Use Netif Expiredefault 192.168.129.65 UGS 1 2162458 bge1[ 158 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!