Discussion Locked

How to configure a LAN with 2 or more IP

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have to PCs in my office and I need to do the following:
The first PC has 2 LAN cards with UTP cables. One of them is connected to a local HUB and the other one to the second PC I have, which is an Internet server.
How to configure the IP addresses of the two LAN cards on my PC, and this which is a server, if the OS is FreeBSD ?

3 replies

by cpfeiffe

ifconfig is used to set the IP address for an interface card. Each interface card will be identified by an alphanumeric code to FreeBSD (ex. x10). Type `ifconfig x10 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx' to set the IP address and netmask for your interface (assumed x10 in this example). If your other interface is recognized as x11 just repeat the step and replace x10 with x11, adding the appropriate IP address and netmask for that interface. You should also add a default route (route add default xxx.xxx.xxx.xxx 1) The x's are the IP address of your default gateway.

To make your change permanent edit the /etc/rc.conf file. and change the following values:
network_interfaces="auto"
(auto allows the system to find its interfaces at bootup)
ifconfig_x10="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
ifconfig_x11="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"
defaultrouter="xxx.xxx.xxx.xxx"
(IP address for your default gateway)

Good luck

This discussion is closed to new replies.