# Can't connect to internet using D-Link 2500U



## rudm (Sep 9, 2010)

I have D-Link 2500U in Bridge mode, FreeBSD 7.3 and trying to establish connection with internet. 

ppp.conf

```
default:
  set log Phase tun command 
  set ifaddr 0 0
 
wstream:
  set device PPPoE:vr0 
  set authname login
  set authkey pass
  set dial
  set login
  add default HISADDR
```

resolv.conf

```
nameserver provider dns1
nameserver provider dns2
```

if config shows that htere a re no default route, but when I try to add route, BSD says:

```
route add 192.168.1.1 default
route: writing to routing socket: Network is unreachable
add host 192.168.1.1 gateway default: Network is unreachable
```

when I try ppp -ddial I recieve:

```
Warning: attempt to net_addr_domain(netgraph) after domainfinalize()
```
when I switch off/on router It shows arp conflict

```
bsd kernel: arp: mac-Ð°Ð´Ñ€ÐµÑ is using my IP address 192.168.1.1 on vr0
```
I guess it's because of the same IP for router ant vr0(interface where routrer is pluged in) but in handbook written that I shall assign router IP to net interface to which my router is plugged in, so I don't know what to do. 

I have dynamic IP address, and recieve IP and host configuration from provider - how can I declare it to BSD? I thougth that it would be enough just set router in routing mode and it recieve all settings from provider and then send it to FreeBSD but it didn't work for me.

I will be very grateful for any help from you guys.


----------



## davidgurvich (Sep 9, 2010)

What do you have in rc.conf?


----------



## rudm (Sep 9, 2010)

At first, I had

```
hostame="bsd"
ppp_enable="YES"
ppp_mode="ddial"
ppp_profile="wstream" 
ifconfig_vr0="192.168.1.1 netmask 255.255.255.0"
```

Then, after arp conflict I deleted all, excluding 

```
hostname="bsd"
```


----------



## SirDice (Sep 9, 2010)

Please post the output of `# ifconfig -a`.


----------



## rudm (Sep 24, 2010)

Thank you for answering and sorry for such a long silencw - I could manage to set up internet for my FreeBSD. But now i hae other problem - I'm trying to make simple router but windows 7 client can't connect to BSD and I don't know where to lok, because I've already done all I could imagine
here is my rc.conf

```
#Machine name
hostname="bsd.myhome.local"

#This machine is a network gateway
gateway_enable="YES"

#DSL Modem in router mode
defaultrouter="192.168.1.1"

#interface connected to router D-Link ADSL 2500U
ifconfig_vr0="192.168.1.2 netmask 255.255.255.0"

#interface connected to local network
ifconfig_vr1="192.168.2.1 netmask 255.255.255.0"

#Enable NAT
natd_enable="YES"

#NAT Interface
natd_interface="vr0"

#Enable SSH for remote login
sshd_enable="YES"
```

my resolv.conf

```
nameserver 192.168.1.1 #ADSL Router
nameserver 195.46.116.1 #Provider DNS1
nameserver 192.46.95.1 #Provider DNS2
```

ifconfig -a

```
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2808<VLAN_MTU,WOL_UCAST,WOL_MAGIC>
ether: 00:26:5a:70:71:7f
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (100BaseTX <full-duplex>)
status: active

vr1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2808<VLAN_MTU,WOL_UCAST,WOL_MAGIC>
ether: 00:19:5b:70:4a:11
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
media: Ethernet autoselect (100BaseTX <full-duplex>)
status: active

plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1%lo0 preficlen 64 scoped 0x4
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
```

netstat -rn

```
Internet:    
Destination    Gateway           Flags  Refs    Use  Netif  Expire
default        192.168.1.1       UGS    0       0    vr0 
127.0.0.1      127.0.0.1         UH     0       0    lo0
192.168.1.9/24 link#1            UC     0       0    vr0
192.168.1.1    00:24:01:5c:3e:a8 UHLW   2       6    vr0    103
192.168.2.0/24 link#2            UC     0       0    vr1

Internet6:
Destination      Gateway           Flags  Netif 
 Expire
::1              ::1               UHL    lo0
fe80::1%lo0/64   f80::1%lo0        U      lo0
fe80::1%lo0      link#4            UHL    lo0
ff01:4::/32      fe80::1%lo0       UC     lo0
ff02::%lo0/32    fe80::1%lo0       UC     lo0
```

I assigned 192.168.2.3 netmask 255.255.255.0 Gateway 192.168.2.1 DNS 192.168.2.1 to Windows 
7 There is ping between both FreeBSD interfaces, internet and ADSL router, but there is no ping between FreeBSD and Windows 7


----------

