case $1 in
start)
# loopback
/sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host
/sbin/ip link set lo up
# ethernet
## /sbin/dhcpcd -t 10 -h $HOSTNAME --noipv4ll eth1
/sbin/ip addr add 192.168.1.162/24 dev eth1 broadcast
192.168.1.255 scope global
/sbin/ip link set eth1 up
# ethernet
/sbin/ip addr add 10.0.0.1/8 dev eth0 broadcast 10.255.255.255
/sbin/ip link set eth0 up
/sbin/ip route add default via 192.168.1.254 dev eth1
echo 1 > /proc/sys/net/ipv4/ip_forward
;;
stop)
/usr/bin/killall -q /sbin/dhcpcd
/sbin/ip route del default
/sbin/ip link set eth0 down
/sbin/ip link set eth1 down
/sbin/ip link set lo down
/sbin/ip addr del 127.0.0.1/8 dev lo
/sbin/ip addr del 10.0.0.1/8 dev eth0
/sbin/ip addr del 192.168.1.162/24 dev eth1
/sbin/ip route del default
echo 0 > /proc/sys/net/ipv4/ip_forward
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 [start|stop|restart]"
;;
esac
# End of file
eth1 is connected to my main home network.
eth0 is connected via a crossover cable to a debian box.
I can't make the crux box route packets from the debian box to the
rest of the home network...
debian:~# ping -n 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.197 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.121 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=0.114 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=0.113 ms
^C
--- 10.0.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 0.113/0.136/0.197/0.036 ms
debian:~# ping -n 192.168.1.162
PING 192.168.1.162 (192.168.1.162) 56(84) bytes of data.
64 bytes from 192.168.1.162: icmp_seq=1 ttl=64 time=0.213 ms
64 bytes from 192.168.1.162: icmp_seq=2 ttl=64 time=0.119 ms
64 bytes from 192.168.1.162: icmp_seq=3 ttl=64 time=0.146 ms
^C
--- 192.168.1.162 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.119/0.159/0.213/0.040 ms
debian:~# ping -n 192.168.1.254
PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.
^C
--- 192.168.1.254 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4014ms
1 10.0.0.1 0.212 ms 0.082 ms 0.078 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 *^C
The traceroute and the first and second ping show that packets are
getting from the debian box to the crux box OK. But the rest of the
traceroute shows that the crux box isn't forwarding beyond itself.
Anybody got any clues?
Thanks!
Rick
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
02-03-2011, 09:00 PM
Wawrzyniec Niewodniczański
How to configure CRUX as a router?
On 3 February 2011 21:33, Rick Thomas <rbthomas@pobox.com> wrote:
> Hi!
>
> What configuration things do I have to set up in order to use my crux box as
> a router.
>
How did you configured iptables?
Wawrzek
--
Â*Wawrzyniec NiewodniczaÅ„skiÂ* Â* Â* vel Wawrzek Larry or LarryN
Â* Â* Linux User #177124Â* Â* Â* Â* Â* Â* Â* E-MAIL: wawrzek@gmail.com
Â*PhD in Quantum ChemistryÂ* Â* Â* Â* Â* Â* WWW: http://wawrzek.name
Â*MSc in Molecular EngineeringÂ* Â* Â* Â* Â*Â* JID: wawrzek@jabber.wroc.pl
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux