# Network Configuration of FreeBSD Software Routers



## MikeyWines (Jul 29, 2010)

i,

I am new to FreeBSD, I have 4 PC, 2 are running on Windows XP and the other 2 are running on FreeBSD. I am trying to convert the FreeBSD into software routers. I have configured the NIC card on the FreeBSD's i.e the 2 interfaces bge0 and r10. The network is setup as follows the first PC(Windows XP) is considered to be a client with IP add: 192.168.11.1, default gateway 192.168.11.0, subnetmask 255.255.255.0, the second one is the first software router with NIC interface r10: 192.168.11.2 and bge0 192.168.10.1, the third PC is the software router number 2 with bge0: 192.168.10.2 and r10: 192.168.12.2 the last PC is considered to be a client PC with IP add: 192.168.12.1, DefaultGateway: 192.168.12.0. Could you tell me what I am doing wrong here as the Client and the PC does not ping each other. By the way how can I send you a picture of the network topology for more clarity? The PC's are over an unloaded network.

Many thanks and regards.

Michael


----------



## vivek (Jul 29, 2010)

You need to configure a few things, See http://www.freebsd.org/doc/en/books/handbook/network-routing.html


----------



## MikeyWines (Aug 11, 2010)

Could you please tell me if I am doing something wrong here?

The following is the configuration on in the /etc/rc.conf 

FreeBSD software router 1:


```
gateway_enable=â€YESâ€
inetd_enable=â€YESâ€
keymap=â€uk.isoâ€
sshd enable=â€YESâ€
linux_enable=â€YESâ€

ifconfig_bge0=â€inet 192.168.10.1 netmask 255.255.255.0â€
ipv6_enable=â€YESâ€
defaultrouter=â€192.168.10.1â€
hostname=â€lab1.brunel.ac.ukâ€

ifconfig_r10=â€inet 192.168.11.2 netmask 255.255.255.0â€
ipv6_enable=â€YESâ€
defaultrouter=â€192.168.11.2â€
hostname=â€lab1.brunel.ac.ukâ€
```



FreeBSD software router 2:

```
gateway_enable=â€YESâ€
inetd_enable=â€YESâ€
keymap=â€uk.isoâ€
sshd enable=â€YESâ€
linux_enable=â€YESâ€

ifconfig_bge0=â€inet 192.168.10.2 netmask 255.255.255.0â€
ipv6_enable=â€YESâ€
defaultrouter=â€192.168.10.2â€
hostname=â€lab2.brunel.ac.ukâ€

ifconfig_r10=â€inet 192.168.12.2 netmask 255.255.255.0â€
ipv6_enable=â€YESâ€
defaultrouter=â€192.168.12.2â€
hostname=â€lab2.brunel.ac.ukâ€
```


----------



## kpa (Aug 11, 2010)

You can't have multiple defaultrouter entries for a single host, last defaultrouter entry overrides any previous entries.


----------



## SirDice (Aug 12, 2010)

It's also quite useless to set the default gateway to an ip address that's on the same box.

You need to get some basic TCP/IP knowledge.


----------



## ecazamir (Sep 10, 2010)

MikeyWines said:
			
		

> Could you please tell me if I am doing something wrong here?
> 
> The following is the configuration on in the /etc/rc.conf
> /...trimmed.../
> ...


You have two problems here:
1. The default router can't be the local machine.
2. FreeBSD device naming uses [font="Courier New"]'rl'[/font] (Uppercase is RL) for Realtek 100 MBps cards instead of [font="Courier New"]'r1'[/font] (letter R and numeric one). The first card using realtek 8139 is named [font="Courier New"]rl0[/font] (letter R, letter L, number zero), not [font="Courier New"]r10[/font] (letter R, number one, number zero).
Of course, it can be renamed later, but this is not the case on your setup.


----------

