Help: slattach and gatewaying?!

alexe100

Member


Messages: 44

Hi all,

I have a cable internet connection that ends at my home in a modem (that gives a uniq public ip address). I got a router and now I have 3 computers connected to router in order to be possible all of computers being connected to Internet throught private IP addresses (192.168.*.*), all this handled by router.

Well, connected to the router there is these computers:
Laptop1 (192.168.1.3) ->WinXP
Laptop2 (192.168.1.4) ->WinXP
Desktop (192.168.1.5) ->FreeBSD

On the FreeBSD box, I configured the serial port through slattach in order to use SLIP for an external wireless device. This tiny device has the 192.168.1.2 IP. The tcp/IP of the devices is tiny and implemented/ported my me.


On the FreeBSD box I can make, with success:

ping 192.168.1.1 (router)
ping 192.168.1.2 (device)
ping 192.168.1.3 (laptop1)
ping 192.168.1.4 (laptop2)
ping 192.168.1.5 (FreeBSD)

the device can also reach FREEBSD box (using ping for example).


Consider now the laptop1 - WinXP - 192.168.1.3
Is it possible to reach the device (192.168.1.2) from this winxp box?
If i make
ping 192.168.1.2 it cant find the device.

Please, could you help me?


Here is the commands i use on the FreeBSD box to configure SLIP for the device connected to serial port:
Code:
slattach -l -f -s 2400 /dev/cuad0
ifconfig sl0 102.168.1.5 192.168.1.2
route add 192.168.1.2 - interface 192.168.1.5
ifconfig sl0 mtu 128
route add default 192.168.1.5
ping 192.168.1.2 ->it works!!
ifconfig xl0 192.168.1.5 netmask 255.255.255.0

At least, is it possible?


Thanks a lot

Alex
 

varda

Active Member

Reaction score: 23
Messages: 116

Last time I've used slattach/sl is in 2000 :)

You can use for router end of serial line the same IP as on LAN NIC interface and then specify proxy arp for device side. Example:
Code:
ifconfig sl0 192.168.1.1 192.168.1.2
arp -s 192.168.1.2 00:11:22:33:44:55 pub
You should to replace 00:11:22:33:44:55 with MAC of LAN/Ethernet NIC of router which has 192.168.1.1 IP address. After that you will have two routes like:
Code:
netstat -rn
...
192.168.1.2   192.168.1.1        UGH     0  5913   sl0
192.168.1.2   00:11:22:33:44:55  UHLS2   1     0   eth0
...
And your device 192.168.1.2 will be reachable.

Just take a look to corresponding chapter of Handbook to know from where this taken: http://www.freebsd.org/doc/en/books/handbook/slip.html

If not, you can always devide up segments into subnets. For example set 192.168.1.0/25 subnet for LAN/Ethernet segment, 192.168.1.1/25 for router and 192.168.1.2-126 with gateway to 192.168.1.1 for PC's/laptops. And 192.168.1.128/25 subnet for serial line segment, 192.168.1.129 for router side and 192.168.1.130 address and 192.168.1.129 gateway for device. So you will not need any routes at all becouse the central point is your router which knows about all nodes.

In this case addresses will looks for you like they are presents common address space of 192.168.1.0/24 subnet but really separated in two closer /25.
 
Top