Hallo Leute...
Mein Projekt ist ein eigener Router hinter dem TPLink Mediakonverter
- DNSMASQ Config vendor class 100008,0001
- IPtables Routing & Firewall
- VLAN ID 10 for WAN
- Mediakonverter mit SPF Modul
TO GO
- INTERNET
- IPV6SUPPORT
- IGMP SNOOPING FOR SWISSCOMTV
- 1 GIGABIT BETWEEN LAN AND WAN
Die Config für den DHCP-Server. Die wichtigsten Funktionen es wäre noch viel mehr möglich!
[alarm@alarm ]$ cat /etc/dnsmasq.conf # Configuration file for dnsmasq.
If you want dnsmasq to listen for DHCP and DNS requests only on
specified interfaces (and the loopback) give the name of the
interface (eg eth0) here.
Repeat the line for more than one interface.
interface=br0
Send extra options which are tagged as "red" to any machine whose
DHCP vendorclass string includes the substring "Linux"
dhcp-vendorclass=set:100008,0001
Or you can specify which interface _not_ to listen on
#except-interface=
Or which to listen on by address (remember to include 127.0.0.1 if
you use this.)
listen-address=127.0.0.1
listen-address=192.168.1.1
Uncomment this to enable the integrated DHCP server, you need
to supply the range of addresses available for lease and optionally
a lease time. If you have more than one network, you will need to
repeat this for each network on which you want to supply DHCP
service.
dhcp-range=192.168.1.5,192.168.1.250,255.255.255.0,24h
Hier dhcpcd für das VLAN mit ID 10 und NAME wan10
[code][root@alarm etc]# dhcpcd -U wan10
broadcast_address=100.86.23.255
dhcp_lease_time=7200
dhcp_message_type=5
dhcp_rebinding_time=600
dhcp_renewal_time=300
dhcp_server_identifier=213.3.239.224
domain_name_servers='195.186.1.162 195.186.4.162'
ip_address=100.86.17.230
network_number=100.86.16.0
routers=100.86.16.1
subnet_cidr=21
subnet_mask=255.255.248.0[/code]
Hier das ifconfig für ArchLinux mit ip addr
[code][root@alarm etc]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP group default qlen 1024
link/ether f0:ad:4e:09:6a:7f brd ff:ff:ff:ff:ff:ff
inet6 fe80::f2ad:4eff:fe09:6a7f/64 scope link
valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:ea:a8:06:0b:6a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::50ea:a8ff:fe06:b6a/64 scope link
valid_lft forever preferred_lft forever
4: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether f0:ad:4e:09:6a:7f brd ff:ff:ff:ff:ff:ff
inet6 fe80::f2ad:4eff:fe09:6a7f/64 scope link
valid_lft forever preferred_lft forever
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
link/ether f0:ad:4e:09:6a:7f brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
link/ether f0:ad:4e:09:6a:7f brd ff:ff:ff:ff:ff:ff
7: wan10@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether f0:ad:4e:09:6a:7f brd ff:ff:ff:ff:ff:ff
inet 100.86.17.230/21 brd 100.86.23.255 scope global dynamic wan.10
valid_lft 7156sec preferred_lft 7156sec
inet6 fe80::f2ad:4eff:fe09:6a7f/64 scope link
valid_lft forever preferred_lft forever
[/code]
Hier mein Shellscrpit für den Firewall und auch das Routing
[code]#!/bin/sh
iptables -A FORWARD -i br0 -s 192.168.1.0/255.255.255.0 -j ACCEPT
#iptables -A FORWARD -i wan -d 192.168.1.0/255.255.255.0 -j ACCEPT
iptables -A FORWARD -i wan10 -d 192.168.1.0/255.255.255.0 -j ACCEPT
#iptables -t nat -A POSTROUTING -o wan10 -j MASQUERADE
iptables -t nat -A POSTROUTING -o wan -j MASQUERADE
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
iptables -I INPUT 1 -i br0 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
[/code]
Test der Internet Verbindung
[quote][root@alarm etc]# ping google.ch
PING google.ch (172.217.168.67) 56(84) bytes of data.
--- google.ch ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 162ms
[root@alarm etc]# ping 100.86.17.230
PING 100.86.17.230 (100.86.17.230) 56(84) bytes of data.
--- 100.86.17.230 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 103ms
[root@alarm etc]# ping 100.86.23.255
Do you want to ping broadcast? Then -b. If not, check your local firewall rules.
[root@alarm etc]#
[/quote]
Hier was ip r s von sich gibt sieht man die Resultate....
root@alarm alarm]# ip r s
default via 100.86.16.1 dev wan.10 proto dhcp src 100.86.17.230 metric 207
100.86.16.0/21 dev wan.10 proto dhcp scope link src 100.86.17.230 metric 207
100.86.16.1 dev wan.10 proto dhcp scope link src 100.86.17.230 metric 1024
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.1
Die Konfiguration der Interfaces br0 lan eth0 wan
[NetDev]
Name=br0
Kind=bridge
[Match]
Name=br0
[Network]
Address=192.168.1.1/24
IPForward=ipv4
#IPMasquerade=yes
ConfigureWithoutCarrier=yes
[Match]
Name=eth0
[Match]
Name=lan*
[Network]
Bridge=br0
BindCarrier=eth0
[Match]
Name=wan
[Network]
DHCP=ipv4
DNSSEC=no
BindCarrier=eth0
IPForward=ipv4
;these are arbitrary names, but must match the *.netdev and *.network files
VLAN=wan10
[NetDev]
Name=wan10
Kind=vlan
[VLAN]
Id=10
[Match]
Name=wan10
[Network]
DHCP=ipv4
[DHCP]
UseRoutes=false
Müssen die lan ports 1&2 (br0) im gleichen VLAN10 how wan10? ( Und macht es etwas das die WAN Schnittstelle wan10 heisst?)
Muss das SPF Modul mit dem Swisscomrouter identisch sein oder kann ich auch das Modul von Init7 mit Flexoptik brauchen?
- Das SPF-Modul ist für Fiber7 und Swisscom tauglich
espresssobin.net for link to device
@"x"#939habe schon per Mail probiert hier vielleicht ein bisschen mehr Glück