Portál AbcLinuxu, 29. prosince 2025 23:28
gw:/etc/openvpn # ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:E4:03:35:07
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20a:e4ff:fe03:3507/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5531 errors:0 dropped:0 overruns:0 frame:0
TX packets:5788 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:598523 (584.4 Kb) TX bytes:596932 (582.9 Kb)
Base address:0x4400 Memory:fcde0000-fce00000
eth3 Link encap:Ethernet HWaddr 00:30:4F:4E:4E:EC
inet addr:192.168.50.40 Bcast:192.168.50.255 Mask:255.255.255.0
inet6 addr: fe80::230:4fff:fe4e:4eec/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10402 errors:0 dropped:0 overruns:0 frame:0
TX packets:10797 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1029183 (1005.0 Kb) TX bytes:2321009 (2.2 Mb)
Interrupt:185 Base address:0x8c00
eth4 Link encap:Ethernet HWaddr 00:30:4F:4E:74:AE
inet addr:192.168.100.10 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:193 Base address:0xac00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2322 (2.2 Kb) TX bytes:2322 (2.2 Kb)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.10.1 P-t-P:192.168.10.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:300 (300.0 b) TX bytes:240 (240.0 b)
gw:/etc/openvpn # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.10.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.50.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.10.0 192.168.10.2 255.255.255.0 UG 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.50.254 0.0.0.0 UG 0 0 0 eth3
C:\Documents and Settings\Martin>route PRINT
===========================================================================
Seznam rozhraní
0x1 ........................... MS TCP Loopback interface
0x2 ...00 80 ad 88 0a b6 ...... Macronix MX98715-Based Ethernet Adapter (obecnÚ)
- Packet Scheduler Miniport
0x3 ...00 0c 76 36 72 ae ...... NVIDIA nForce MCP Networking Controller - Packet
Scheduler Miniport
0x4 ...00 ff a2 5e bc 9f ...... TAP-Win32 Adapter V8 - Packet Scheduler Miniport
===========================================================================
===========================================================================
Aktivní směrování:
Cíl v síti Síťová maska Brána Rozhraní Metrika
0.0.0.0 0.0.0.0 192.168.50.254 192.168.50.167 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.10.5 192.168.10.6 1
192.168.10.1 255.255.255.255 192.168.10.5 192.168.10.6 1
192.168.10.4 255.255.255.252 192.168.10.6 192.168.10.6 30
192.168.10.6 255.255.255.255 127.0.0.1 127.0.0.1 30
192.168.10.255 255.255.255.255 192.168.10.6 192.168.10.6 30
192.168.50.0 255.255.255.0 192.168.50.167 192.168.50.167 20
192.168.50.167 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.50.255 255.255.255.255 192.168.50.167 192.168.50.167 20
224.0.0.0 240.0.0.0 192.168.10.6 192.168.10.6 30
224.0.0.0 240.0.0.0 192.168.50.167 192.168.50.167 20
255.255.255.255 255.255.255.255 192.168.10.6 192.168.10.6 1
255.255.255.255 255.255.255.255 192.168.10.6 2 1
255.255.255.255 255.255.255.255 192.168.50.167 192.168.50.167 1
Výchozí brána: 192.168.50.254
===========================================================================
Trvalé trasy:
Žádné
Config na serveru:
port 5000
proto udp
dev tun
;up ./server.up
ca /etc/openvpn/certs/ca.crt
cert /etc/openvpn/certs/server.crt
key /etc/openvpn/certs/server.key
dh /etc/openvpn/certs/dh1024.pem
server 192.168.10.0 255.255.255.0
ifconfig-pool-persist ipp2.txt
push "route 192.168.1.0 255.255.255.0"
push "dhcp-option DOMAIN emarcom.cz"
client-to-client
keepalive 10 120
user nobody
group nogroup
comp-lzo
persist-tun
persist-key
log /var/log/openvpn.log
verb 6
Config na clientu:
remote 192.168.50.40
port 5000
tls-client
proto udp
dev tun
pull
route-method exe
comp-lzo
verb 3
ca MarCom-CA.crt
cert Martin-Kuna.crt
key Martin-Kuna.key
Diky za jakoukoliv radu.
Chain FORWARD (policy DROP) target prot opt source destination TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU forward_int all -- anywhere anywhere forward_ext all -- anywhere anywhere forward_ext all -- anywhere anywhere LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWD-ILL-ROUTING ' DROP all -- anywhere anywhereDo iptables prilis nevidim, pouzivam pro nastaveni firewallu Yast, mam SusE.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.