Set a new pc router from bsd

  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

after all, and from the previous topic that i made, i finally want to build a
new pc router based on freebsd,

ok, i have the all the hardware, one pc with two nic, everything is old,

what is my next step?what software should i download?

p/s: I works in the lab, and there is a dhcp server in here, so i can access to the internet.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

you're going to need to download & burn freebsd..
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

yep, i already done that,
but there is a problem,

here's the idea,

the PC A got two nic, and the PC B act as client, it is connected to the nic_one of PC A, and then nic_two for PC A got its IP from dhcp server..

but, when i ping from PC A, the output is like this
ping: sendto: Host is down

why? can types of cable be a problem? such as cross or straight..

p/s:nvmind, after this i'll sketch a diagram
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

PC -> PC does use a cross over cable. Always use a crossover if you connect two like-devices together (router>router, switch>switch, etc.)
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Actually, crossover cables are usually unnecessary with most modern devices. The devices perform the crossover automatically.
Wikipedia wrote:
Almost all newer Ethernet network interface cards (NICs), switches and hubs automatically apply an internal crossover when necessary. This feature is known by various vendor-specific terms, e.g., Netgear calls it Auto uplink and trade, and other common vendor terms include Auto-MDI/MDI-X, Universal Cable Recognition and Auto Sensing. This eliminates the need for crossover cables, obsoletes the uplink/normal ports and manual selector switches found on many older hubs and switches, and greatly reduces installation errors, especially by non-technical users.

Automatic MDI/MDI-X capability is specified in the 1000BASE-T standard, so straight-through cables will work in almost all cases. But it is optional, so a crossover cable is needed if neither of the connected devices supports it, or the function has been disabled.

So any CAT5 or CAT6 should work just fine.
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

Man, that must be shiny new. We just recently started getting switches that can detect whether or not you have POE for voip phones and stuff, kind of similar but still different.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

I'm not sure exactly when it became part of the standard, but I've never gone out of my way to use a crossover cable; I've been using ordinary cables for router-to-router and NIC-to-NIC purposes for at least three or four years, and I've never had a problem.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Wait what?

Do you have gateway enabled? Are you employing NAT? Have you done any configurations save installing the base FBSD OS?

You know these things don't do specific tasks right out of the box. :)

Oh, and no need to use crossover cables these days. Unless the NIC in question is very old.
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

Hye
my question is solved from all the poster's info here,

yes, my pc contain two old nic, so, very2 old i think.
it is just like daemonguy said..so, i have to use cross cable.

by now, i'm trying to configure a freebsd router, if anything goes wrong, i will post here..
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

hye guys, i just want to ask a few a questions,

i'm sketching a draft of network diagram, where should i put the firewall image? is it before the router(if we are from LAN), or after the router?
do you get what i means?
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

I think usually the firewall will go on the internal side of the router, the router will NAT everything from the IP you get from the ISP to your IP range on your network, then the firewall does all the filtering and stuff. Most modern day firewall appliances anymore do routing functions so you can get away without a router sometimes, but not always.
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

hye,
i'm currently stuck at configuring dhcp server, which the error is like the following output
Code: [ Select ]
=> Couldn't fetch it - please try to retrieve this
=>port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/ports/net/isc-dhcp3-server.
*** Error code 1

Stop in /usr/ports/net/isc-dhcp3-server.
  1. => Couldn't fetch it - please try to retrieve this
  2. =>port manually into /usr/ports/distfiles/ and try again.
  3. *** Error code 1
  4. Stop in /usr/ports/net/isc-dhcp3-server.
  5. *** Error code 1
  6. Stop in /usr/ports/net/isc-dhcp3-server.


what happen actually? is the server that i trying to retrive has down or what?
and how do i port manually into /usr/ports/distfiles/?
for your information,
the error comes after i enter the command, 'make install clean'
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Before you do anything you should always cvsup your ports tree.

More than likely with an error just like that, you are trying to fetch an old, outdated port.

In other words, the package is so old, it no longer is hosted in the main tree.

Update ports and try again.

[I will presume you have no idea what 'update ports' means, so
http://www.freebsd.org/doc/en_US.ISO885 ... using.html
Specifically, the section on cvsupping the ports tree. ]
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

thanks daemonguy,
perhaps because i didnt update my port.
mmm.. may i ask something else?


if...
after i set the configuration, and there is failure on the configuration,how can i restore back my configuration to old configuration? such as restoring in windows? is there any command?

just wondering..
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

You could use dump to backup to tape or another server or whatever, then I believe the command to restore is just simply restore. I don't think that is true, I've never done it before but I remember it being super obvious and simple.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

When you say 'configuration' you mean of dhcp itself? If so, then yes you can always go back and alter the config.
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

hello guys, i think i have failed to configure the freebsd pc router, i really don't know where actually i have failed..i used this guide very very carefully..
http://www.bsdguides.org/guides/freebsd/networking/ho_router_pf.php

i give u my scenario here as well as the diagram,
actually, there is a dhcp server over here, which all the pc can connect through the net..
Image

my first network card that connected to the dhcp server lab is xl0.. it gets its ip, 10.100.100.227

the second network card is fxp0, i tried to assigned this as 192.168.10.1.
so the internal network has 192.168.10.0 as a network id along with its subnet, 255.255.255.0

My problem here is why the client, which is also freebsd, cannot get 192.168.10.xxx ? it still get the ip like this, 10.100.100.91..

When i try connect a windows client, it get the ip as automatic private address, 169.254.251.230 or 'limited or no connectivity'?

and can you give me a suggestion for what is gateway ip, option-domain-name server ip etc etc..

thanks in advance
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

The 169 is a standard setting in most system to denote there is no DHCP being offered.

You need to have gateway enabled.
You need to have nat.
You need to have dhcpd enabled and configured properly. (that includes rc.conf)
You should have BIND loaded and configured as well, to forward DNS requests.

The scope of your question really goes beyond a simple answer in this forum. You are not asking one thing, you are asking multiple things in a single query.

Essentially, snippets of your configs should be as follows (or close proximities):

Code: [ Select ]
rc.conf:
ifconfig_xl0="DHCP"
ifconfig_fxp0="inet 192.168.10.1 netmask 255.255.255.0"
gateway_enable="YES"
### DHCP server
dhcpd_enable="YES"
dhcpd_ifaces="xl0" # enabled on int. interface

### DNS server - BIND
named_enable="YES"
  1. rc.conf:
  2. ifconfig_xl0="DHCP"
  3. ifconfig_fxp0="inet 192.168.10.1 netmask 255.255.255.0"
  4. gateway_enable="YES"
  5. ### DHCP server
  6. dhcpd_enable="YES"
  7. dhcpd_ifaces="xl0" # enabled on int. interface
  8. ### DNS server - BIND
  9. named_enable="YES"



Code: [ Select ]
dhcpd.conf:

subnet 192.168.10.0 netmask 255.255.255.0 {
 range 192.168.10.100 192.168.10.200;
 option domain-name-servers 192.168.10.1;
 option domain-name "mynetwork";
 option routers 192.168.10.1;
 option broadcast-address 192.168.10.255;
 default-lease-time 86400;
 max-lease-time 86400;
}
  1. dhcpd.conf:
  2. subnet 192.168.10.0 netmask 255.255.255.0 {
  3.  range 192.168.10.100 192.168.10.200;
  4.  option domain-name-servers 192.168.10.1;
  5.  option domain-name "mynetwork";
  6.  option routers 192.168.10.1;
  7.  option broadcast-address 192.168.10.255;
  8.  default-lease-time 86400;
  9.  max-lease-time 86400;
  10. }


Code: [ Select ]
named.conf:

    forwarders {
        <single line per entry list of ips for dns resolution>
    };

zone "mynetwork" {
    type master;
    file "mynetwork.hosts";
};

zone "10.168.192.in-addr.arpa" {
    type master;
    file "10.168.192.rev";
};
  1. named.conf:
  2.     forwarders {
  3.         <single line per entry list of ips for dns resolution>
  4.     };
  5. zone "mynetwork" {
  6.     type master;
  7.     file "mynetwork.hosts";
  8. };
  9. zone "10.168.192.in-addr.arpa" {
  10.     type master;
  11.     file "10.168.192.rev";
  12. };


This is just an idea of the sorts of configs you need to ensure are complete and by no means should be indicative of a finished config example.
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

thanks for your reply, by this time i cannot go to our lab, there is a holiday until next monday, and the lab wont be open.
geez.. i hate holiday..

perhaps, in this period time, i should learn more about dhcp configuration..

i just want to ask something, daemonguy, is this only three config that i should edit? Any else?

and what actually function of forwarders?
  • Janrocks
  • Graduate
  • Graduate
  • User avatar
  • Posts: 165
  • Loc: between

Post 3+ Months Ago

Quote:
The 169 is a standard setting in most system to denote there is no DHCP being offered.


I wondered why sometimes NIC's seemed to go mad and no matter what you did to them defaulted to this strange number.. I'm going to take a look at some of those strange old NIC's that I scrapped to the junkbox because they refused to allow IP to be set...
Learn something every day :lol:
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

i just want to ask one question..
i searching in google and end up in one forum(cant remember), some of the user said that, on one network, it cannot have more than one dhcp server, is it true?
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Yes, those few *should* cover you -- at least in as much as these specific configurations. There are of course, base configurations that need to be set as well; I could not possibly go into everything that needs configuring to get a server up.

A forwarder is just that; it forwards requests (in this case DNS requests).

As for number of dhcp servers; true enough. In a single network segment, you can have only one dhcp server (this is discounting high availability offerings in a clustered capacity).

That does not mean you can't have 2 on the same network, but different segments.
  • gamekiller
  • Graduate
  • Graduate
  • gamekiller
  • Posts: 101
  • Loc: above the chair

Post 3+ Months Ago

Hye, after a long time, my configuration still wont work..

i try to make a internet connection here.. to make sure that the client can get through the internet WITHOUT using DHCP server.. just a simple connection i guess.

the following image, describe my situation now.
Image

i already compile the kernel,using the following guide..
http://www.freebsd.org/doc/en_US.ISO885 ... -natd.html

i dont install the isc-server first since i need to test the connection from the client..so what i'have do is, put the ip for the windows client as 192.168.0.2
while the fxp0 is 192.168.0.1, and the the other nic as xl0 which connect to the dhcp lab server.. so, i still didnt get it.. here, i post a few of my configuration, it will take a long page i guess..

netstat -nr
Image

for /etc/rc.conf
Quote:
keymap="us.iso"
linux_enable="YES"
local_startup="/usr/local/etc/rc.d"
moused_enable="YES"
usbd_enable="YES"

firewall_enable="YES"
gateway_enable="YES"
firewall_type="OPEN"
ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0"
natd_enable="YES"
natd_interface="xl0"
natd_flags=""

ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0"
defaultrouter="10.100.100.1"
hostname="fxp0_card"
ifconfig_xl0="DHCP"


for ifconfig -a
Quote:
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:90:27:a6:27:69
media: Ethernet autoselect (none)
status: no carrier

xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 10.100.100.227 netmask 0xfffffc00 broadcast 10.100.103.255
ether 00:60:08:2d:8f:c8
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active

plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000


for command ipfw -a list
Quote:
00050 123 11098 divert 8668 ip4 from any to any via xl0
00100 0 0 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
65000 139 12394 allow ip from any to any
65535 18 1805 allow ip from any to any


for ps -axwu
Quote:
root 615 0.0 0.4 1524 1016 ?? Ss 4:32PM 0:16.90 /sbin/natd -dynamic -n xl0


please guide me..if u need other configuration just tell me..

Post Information

  • Total Posts in this topic: 23 posts
  • Users browsing this forum: No registered users and 56 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.