000
10.06.2003, 14:22 Uhr
~arkantos
Gast
|
hallo leute! hab folgendes gefunden. kann mir jmd die 2 shellscripte erklären? eignen die sich für mein vorhaben?
will von linuxclientseite meinem linuxserver was schicken. der server soll des nicht wie bisher per software zurückschleifen, sondern der kernel soll des irgendwie zurückschleifen...
7.6.1. A tunneled network configuration. 192.168.1/24 192.168.2/24 - - | ppp0 = ppp0 = | | aaa.bbb.ccc.ddd fff.ggg.hhh.iii | | | | /-----\ /-----\ | | | | // | | | |---| A |------//---------| B |---| | | | // | | | | \-----/ \-----/ | | | - -
The diagram illustrates another possible reason to use IPIP encapsulation; virtual private networking. This example presupposes that you have two machines, each with a simple dial up Internet connection. Each host is allocated just a single IP address. Behind each of these machines are some private local area networks. These LANs are configured with reserved IP network addresses. Suppose that you want to allow any host on network A to connect to any host on network B (just as if they were properly connected to the Internet with a network route). IPIP encapsulation will allow you to do this configuration. Note: encapsulation does not solve the problem of how you get the hosts on networks A and B to talk to any other on the Internet. You will still need to use tricks like IP Masquerade. Encapsulation is normally performed by machines functioning as routers.
Linux router `A' would be configured with a script like the following:
Code: |
#!/bin/sh PATH=/sbin:/usr/sbin mask=255.255.255.0 remotegw=fff.ggg.hhh.iii # # Ethernet configuration ifconfig eth0 192.168.1.1 netmask $mask up route add -net 192.168.1.0 netmask $mask eth0 # # ppp0 configuration (start ppp link, set default route) pppd route add default ppp0 # # Tunnel device configuration ifconfig tunl0 192.168.1.1 up route add -net 192.168.2.0 netmask $mask gw $remotegw tunl0
|
Linux router `B' would be configured with a similar script:
Code: |
#!/bin/sh PATH=/sbin:/usr/sbin mask=255.255.255.0 remotegw=aaa.bbb.ccc.ddd # # Ethernet configuration ifconfig eth0 192.168.2.1 netmask $mask up route add -net 192.168.2.0 netmask $mask eth0 # # ppp0 configuration (start ppp link, set default route) pppd route add default ppp0 # # Tunnel device configuration ifconfig tunl0 192.168.2.1 up route add -net 192.168.1.0 netmask $mask gw $remotegw tunl0
|
The command:
Code: |
route add -net 192.168.1.0 netmask $mask gw $remotegw tunl0
|
reads: `Send any datagrams destined for 192.168.1.0/24 inside an IPIP encap datagram with a destination address of aaa.bbb.ccc.ddd'.
Note that the configurations are reciprocated at either end. The tunnel device uses the `gw' in the route as the destination of the IP datagram (where it will place the datagram it has received to route). That machine must know how to decapsulate IPIP datagrams. In other words, it must also be configured with a tunnel device.
Danke für jede Hilfe |