de ifconfig commando's gaan idd niet goed op de server
hieronder staan de scripts, die ik gebruik
1 = server config
2 = client config
3 = apart scriptje om een paar irritante zaken te automatizeren
het probleem is dat vanaf de client alles perfect schijnt te werken kan gewoon pingen elke host
maar vanaf de server(192.168.0.x) kan ik het 192.168.1.x netwerk niet benaderen terwijl andersom het dus wel kan
omdat ik niet weet wat/waar het probleem zit post ik zoveel mogelijk info, het 3de script is maar tijdelijk totdat ik een oplossing heb.
o, ja ik heb op de server een tun0 device voor ADSL verbinding
server vtund.conf FreeBSD 4.8
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
| options {
port 5000; # Listen on this port.
# Syslog facility
syslog daemon;
# Path to various programs
ppp /usr/sbin/pppd;
ifconfig /sbin/ifconfig;
route /sbin/route;
firewall /sbin/ipfw;
ip /sbin/ip;
}
# Default session options
default {
compress no; # Compression is off by default
speed 0; # By default maximum speed, NO shaping
}
lion {
pass leef12; # Password
type ether; # Ethernet tunnel
device tap1; # Device tap0
proto tcp; # UDP protocol
comp lzo:1; # LZO compression level 1
encr no; # Encryption
stat yes; # Log connection statistic
keepalive yes; # Keep connection alive
up {
# Connection is Up
# Assign IP address
ifconfig "%% create";
ifconfig "%% inet 192.168.1.254 netmask 255.255.255.0";
route "-n add -net 192.168.1.0 -iface tap1"
ifconfig tap1 inet 192.168.1.254 netmask 255.255.255.0
};
down {
# Connection is Down
ifconfig "%% down";
};
} |
de client vtund.conf FreeBSD 4.5
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| options {
port 5000; # Connect to this port.
timeout 60; # General timeout
# Path to various programs
ppp /usr/sbin/pppd;
ifconfig /sbin/ifconfig;
route /sbin/route;
firewall /sbin/ipfw;
}
# Ethernet example. Session 'lion'.
lion {
pass leef12; # Password
type ether; # Ethernet tunnel
device tap1; # Device tap1
proto tcp;
up {
# Connection is Up
# Assign IP address and netmask.
ifconfig "%% create";
ifconfig "%% inet 192.168.0.254 netmask 255.255.255.0";
route "-n add -net 192.168.0.0 -iface tap1";
};
down {
# Connection is Down
# Shutdown tap device
ifconfig "%% down";
};
} |
de volgende code is voor zowel client / server alleen vtund -s kan ook vtund lion x.x.x.x zijn, en natuurlijk 192.168.0.254 ipv 192.168.1.254
code:
1
2
3
4
5
6
7
8
| #!/bin/sh
ifconfig tap1 create
vtund -s
ifconfig tap1 inet 192.168.1.254 netmask 255.255.255.0
sysctl -w net.link.ether.bridge=1
sysctl -w net.link.ether.bridge_ipfw=1
sysctl -w net.inet.ip.fw.one_pass=1
sysctl -w net.link.ether.bridge_cfg=fxp1:1,tap1:1 |